Jump to content

All Activity

This stream auto-updates

  1. Today
  2. When you WBLOCK each solid, leave it at its real world coordinates and use a common base point of 0,0,0 for every file. If you move each solid to the origin before export, DIALux has no relative position left to rebuild the room. Keep the same units in AutoCAD and DIALux (metres is safest); a units mismatch is the usual reason imports appear in the wrong place even when the base point is consistent. Because you already have each solid on its own layer, naming the WBLOCK after the layer is fine. Prefer DWG over 3DS if evo will accept it, and lower FACETRES if the mesh is too heavy. After import, check one known corner against the original coordinates before you assign materials.
  3. The existing WOW LISP copies each luminaire to the same distance along the new path, which is the right idea for uneven spacing. One important lighting detail: the routine inserts the block at rotation 0, so fittings will not turn with the curve. When you insert, set the rotation from the path tangent (the direction of the first derivative at that distance) so linear or wall-wash luminaires stay aligned to the run. Also confirm both polylines are measured from the same end; if they run in opposite directions the fixtures will be mirrored along the path. If the curved path is slightly shorter than the straight one, the last fitting may land on the end point — that is usually acceptable for a millimetre-level difference, but check the last spacing on a long street or cove run.
  4. An IES web light only stores the far-field intensity distribution; it does not make the fixture geometry look like it is emitting. Keep the IES light for the room illumination, and give the lamp or diffuser a self-illuminated material (luminance in candelas per square metre) so the source itself glows in the render. Avoid adding a second spherical photometric light on top of the IES file, or you will roughly double the flux in the scene. If the downlight pattern only appears low on the wall, the IES is probably a narrow-beam or recessed cut-off distribution. Check that the web's nadir points straight down, place the light at the real ceiling height, and try a wider-beam IES if you want the scallop higher up the wall.
  5. Big thanks, this solves the problem nicely!
  6. Yesterday
  7. Last week
  8. box_animation.mp4 box_animation.mp4 I thought I would have some more fun with this problem. As I posted earlier, I think AutoCAD's parametric features offer a good solution. Here's an easier construct. Open the attached file and go to the Parametric tab and click Show All or enter the command DCDISPLAY and select the box to see the dimensional constraints. Change the value of dimension d3 to see the box in a different position agaist the wall. The following VLISP program creates a box of user specified dimensions and animates it position and orientation as it slides along the floow and wall. 0,0 is assumed to be the lower corner of the wall. box_animation.mp4 ;Creates an animation of a rectangle slding along a floor ; as it rotates leaning agains a wall. ; 11/13/2026 (defun c:boxanimate (/ ang boxL boxW dAngle dAngleR p i d vlaObj nSteps dx) (vl-load-com) (setq boxL (getreal "\nEnter box length (9): ")) (if (not boxL) (setq boxL 9) ) (setq boxw (getreal "\nEnter box width (2) ")) (if (not boxW) (setq boxW 2) ) (setq dAngle 1 ; rotation angle increment ang dAngle ; total rotation dAngleR (/ (* pi dAngle) 180.) p (list (- boxL) 0) ; poit of rotation i 0 d 100 ; delay value ) (command "_rectangle" "_non" p "_non" (list 0 boxW)) (setq vlaObj (vlax-ename->vla-object (entlast))) (setq nSteps (/ 90 dAngle)) (setvar "CMDECHO" 0) (while (< i nsteps) (setq angR (/ (* pi ang) 180.)) (setq dx (abs (+ (car p) (* boxL (cos angR))))) (vla-Rotate vlaObj (vlax-3d-point p) dAngleR) (vla-Move vlaObj (vlax-3d-point '(0.0 0.0 0.0)) (vlax-3d-point (list dx 0.0 0.0)) ) (setq ang (+ ang dAngle) p (mapcar '+ p (list dx 0)) ) (vla-update (vlax-get-acad-object)) (command-s "_.REGEN") (command "_.DELAY" 100) (setq i (1+ i)) ) (setvar "CMDECHO" 1) (princ) ) ; end defun box fit.02.dwg
  9. That somewhat falls on the engineer/designer doesn't it? I follow (normally) GD&T and the use of LMC and MMC when necessary along with the tolerances per class of fit. If properly designed with the appropriate tolerances and machined within those tolerances, it should fit properly. I usually draw objects that have tolerances at the median of the size if the tolerance is ± if it is -0 or +0 I draw it at that size in general, but really depends on the parts and the LMC/MMC. Unless instructed differently, most items I just look in the books and go with snug fit or loose fit depending on the assembly.
  10. Lee Mac

    Dynamic variables

    This should suffice: (defun sortlist ( l ) (vl-sort l (function (lambda ( a b / x y ) (while (and (setq x (car a)) (setq y (car b)) (equal x y 1e-8)) (setq a (cdr a) b (cdr b) ) ) (if (and x y) (< x y) (null x)) ) ) ) )
  11. When several machined components fit together in an assembly, even small dimensional variations can accumulate and affect the final fit. A drawing may show every individual component within its specified tolerance, yet the assembled parts may still create alignment problems or unwanted clearance. This becomes particularly challenging when dimensions are controlled independently rather than from a common functional datum. When checking tolerance stack-up in mechanical assemblies, do you prefer worst-case analysis, statistical tolerance analysis, or a direct measurement approach? How do you decide which method is appropriate for production?
  12. For this type of work, I would recommend DIALux evo rather than relying on an AutoCAD LISP routine. It supports DWG floor-plan imports, lighting fixture placement, and photometric calculations using manufacturer IES/LDT files. You can check illuminance levels, uniformity, and fixture arrangements against project requirements, then export the results and layouts. It is free to use, although fixture availability depends on the manufacturers supported. This would be much more practical for verifying lighting compliance than designing entirely inside AutoCAD.
  13. For a quick check of that spec, the lumen method is usually enough before you pick a tool. 50 fc is roughly 540 lux. Fixtures needed = (E x A) / (lumens x UF x LLF). With the work plane at 30" and the suspended ceiling at about 9', the cavity height is roughly 6'. Typical utilisation for a 2x2 LED troffer in a light-coloured room is 0.6 to 0.7, with a light loss factor of 0.8 to 0.85. At 2000 lm per fixture that works out to roughly one fixture per 25 to 30 sq ft, so check the result against the manufacturer's maximum spacing-to-mounting-height ratio. Then place the fixtures on a grid matching the ceiling tiles in the RCP.
  14. @emosms did you give it a try ? It is only a very early start in the coding just a show how it could be done.
  15. BIGAL

    Dynamic variables

    You should have said at the 1st post want to sort up to 5 items deep in a list. I had this task for something else I did. Hopefully this is a dummy of what your after. it is amost instant to make 10000 items and sort them. I apoligise I forget where I got the complex sort from regarding authors name. ; sort on up to 5 items in sub lists ; By AlanH (defun compare-elements (a b sortspec) ((lambda (x y test) (if (and (equal x y ) (cdr sortspec)) (compare-elements a b (cdr sortspec)) (apply test (list x y)) ) ) (nth (cdar sortspec) a) (nth (cdar sortspec) b) (caar sortspec) ) ) (defun complex-sort (alst sortspec) (vl-sort alst '(lambda (a b) (compare-elements a b sortspec) ) ) ) ;; Rand - Lee Mac ;; PRNG implementing a linear congruential generator with ;; parameters derived from the book 'Numerical Recipes' (defun LM:rand ( / a c m ) (setq m 4294967296.0 a 1664525.0 c 1013904223.0 $xn (rem (+ c (* a (cond ($xn) ((getvar 'date))))) m) ) (/ $xn m) ) ;; Random in Range - Lee Mac ;; Returns a pseudo-random integral number in a given range (inclusive) (defun LM:randrange ( a b ) (+ (min a b) (fix (* (LM:rand) (1+ (abs (- a b)))))) ) (defun wow ( / ) (setq lst '()) (repeat 10000 (setq v1 (atoi (rtos (LM:randrange 1 1000 ) 2 0))) (setq v2 (atof (rtos (LM:randrange 1 1000 ) 2 3))) (setq v3 (atof (rtos (LM:randrange 1 1000 ) 2 3))) (setq v4 (atof (rtos (LM:randrange 1 1000 ) 2 3))) (setq v5 (atof (rtos (LM:randrange 1 1000 ) 2 3))) (setq lst (cons (list v1 v2 v3 v4 v5) lst)) ) (setq numcols (length (car lst))) (cond ((= numcols 1)(setq lst (complex-sort lst '((< . 0))))) ((= numcols 2)(setq lst (complex-sort lst '((< . 0) (< . 1))))) ((= numcols 3)(setq lst (complex-sort lst '((< . 0) (< . 1) (< . 2))))) ((= numcols 4)(setq lst (complex-sort lst '((< . 0) (< . 1) (< . 2)(< . 3))))) ((= numcols 5)(setq lst (complex-sort lst '((< . 0) (< . 1) (< . 2)(< . 3)(< . 4))))) ((> numcols 5)(setq lst (complex-sort lst '((< . 0) (< . 1) (< . 2)(< . 3)(< . 4))))) ) (princ) ) (wow)
  16. Lee Mac

    Dynamic variables

    I would strongly advise against using that bubblesort function, it is horribly inefficient. (vl-sort)/(vl-sort-i) both use a version of quicksort (one of the fastest sorting algorithms), implemented in C++; as such, they will always outperform any other sorting algorithm implemented using the LISP API. If the subset is known prior to sorting then sort only the subset (since the sort is the heaviest operation); else you have no choice but to take the subset following the sort.
  17. PGia

    Dynamic variables

    @BIGAL Thanks. I've tried Bubblesort and it seems to work well. But won't the recursive call to Bubblepass be problematic with very long lists? I've run into this problem a couple of times while doing my tests. Thank you very much, @Lee Mac I didn't know about vl-sort-i until now. After trying it, I think it's the best solution. The only drawback is that it always returns the full list of indices even though the user might only need a smaller number of elements. However, it works very fast even with very large lists, so this isn't a problem. By the way: my lists consist of lists of 5 numbers: 1 integer and 4 real numbers, which I need to sort from lowest to highest and with a preference order from left to right.
  18. mhupp

    Dynamic variables

    Yes, could be a good thing or a bad thing depending on what PGia wants to do. like I wouldn't use the entity name as the key as they are generated when opening the drawing and would be invalid next time you open said drawing. Also I think you can only store strings in the dotted pair. was only bringing as another option for a faster search of a "list".
  19. Lee Mac

    Dynamic variables

    Stating the obvious: just consider that creating xrecords & dictionaries is modifying the drawing database and the data is stored in the drawing, whereas LISP data is obviously transient.
  20. In sheet metal design, a 3D folded model and its 2D flat pattern must agree with the actual manufacturing requirements. Small differences in bend allowance, inside radius, material thickness, or K-factor can produce incorrect developed dimensions. This becomes particularly important when drawings are prepared in one CAD application and the flat patterns are exported as DXF for CNC cutting. How do you maintain consistency between the folded model and the exported flat pattern? Do you rely on CAD-generated bend calculations, manufacturer-specific bend tables, or independently verify the developed dimensions?
  21. yes,Converting units is straightforward, but correcting incorrect coordinate references can create much bigger problems.
  22. indiancad

    Baseball Lighting Design in AutoCAD

    Four 50-foot corner poles may not provide uniform coverage, especially in the deep outfield. Use photometric simulation with actual LED IES files to optimise fixture angles, beam distribution, and mounting height. Asymmetric optics and glare shields can also reduce spillover toward the seating areas. Focus on uniform field illumination rather than simply increasing brightness.
  23. AONE_LED

    Baseball Lighting Design in AutoCAD

    Corner-only poles are the main reason for uneven outfield light and spill. Sports fields are normally lit from four poles placed outside the foul lines, not at the diamond corners, or from six to eight poles around the perimeter. Use narrow-beam floodlights with sharp cut-off optics for the deep outfield, aimed at roughly 20 to 30 degrees below horizontal, and wide-beam units for the infield. Higher aiming angles throw light into the stands, so keep tilt moderate and add external louvres or shields on the fixtures facing the seating. Typical targets are about 500 to 750 lux infield and 300 to 500 lux outfield, with uniformity (min/avg) of 0.5 or better. Verify with a point-by-point grid calculation using IES files before finalising pole positions, because AutoCAD renders cannot give reliable lux values.
  24. AutoCAD has no tool that reads lux at an arbitrary point, so you need a workaround. Use photometric lights (set LIGHTINGUNITS to 1 or 2, define lights by candela or lumens, ideally with an IES web file) and render with a photometric exposure setting. Pixel brightness in a render is only a visual indication, not a calibrated lux reading. For an actual value at a point, use the inverse square law, E = I x cos(theta) / d squared, taking the candela from the IES file in the direction of the point; measure at working height, normally 0.8 m for a desk or floor level for corridors. For a real design, export the luminaires to a dedicated lighting calculation program that outputs a lux grid on the working plane.
  25. mhupp

    Dynamic variables

    Dictionary is an object in the drawing file. (setq mainDict (namedobjdict)) (dictadd mainDict "PART001" ;this is they unique key (entmakex '((0 . "XRECORD") ;needed (100 . "AcDbXrecord") ;needed (1 . "Steel") (2 . "Description") (3 . "12.5") (4 . "24") (5 . "100") (6 . "Black") ) ) ) (setq color (cdr (assoc 6 (dictsearch Maindict "PART001")))) So the main "list" or Dictionary is mainDict you then need a key to store the sub list under "PART001" and then as many dotted pairs as you want. dictsearch would be alot faster than assoc with 20,000 list.
  26. Welcome aboard. There are various other ways of getting street maps, as I worked for a government authority had access to vector, images and 3d Lidar. You can approach authorities for maps, may be a cost. Google earth ?
  27. Working for a government Authority if a dwg was provided at 0,0. It would be quickly rejected and the company asked to fix at correct world co-ordinates especially if they wanted to be paid. Doubtful we would use them again. We worked on roads fully surveyed say 5km in length. Personally @indiancad dont see this as a question rather make sure your contract regarding co-ordinates is clearly stated. Ps yes had architects plans in mm we did have to convert to m but had advantage of survey control points in those dwg's as the initial supplied field data was world true.
  28. BIGAL

    components into blocks

    Like @SLW210 depends on how the appliances are laid out in the dwg if in say a grid then all can be exported in one go, if have to select objects as random objects location, can still be done. Have you used "Wblock" ? Yes need sample dwg.
  1. Load more activity
×
×
  • Create New...