Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Did something similar for vehicle driveway checking, just a maybe make the box like 2mm smaller than true size and position and rotate, use intersectwith to see if the box and walls touch you will get nil if they dont.touch. Say stop when get points.
  3. BIGAL

    Dynamic variables

    This was created by Copilot, limited testing. and only sorts on single item. (defun BubblePass (lst / a b) (cond ((or (null lst) (null (cdr lst))) lst) ((> (car lst) (cadr lst)) (cons (cadr lst) (BubblePass (cons (car lst) (cddr lst))))) (t (cons (car lst) (BubblePass (cdr lst)))) ) ) (defun BubbleSort (lst / i) (repeat (length lst) (setq lst (BubblePass lst)) ) lst ) Asked about sort on 1st 2 items in list (defun QSORT2 (lst / pivot) (defun _less (a b) (or (< (car a) (car b)) (and (= (car a) (car b)) (< (cadr a) (cadr b))))) (if (cdr lst) (progn (setq pivot (car lst)) (append (QSORT2 (vl-remove-if-not '(lambda (x) (_less x pivot)) (cdr lst))) (list pivot) (QSORT2 (vl-remove-if-not '(lambda (x) (not (_less x pivot))) (cdr lst))) ) ) lst ) ) Limited testing.
  4. Today
  5. rlx

    Center mark replacement

    Yeah lisp is a little on the background right now , wife has some serious health issues so my attention lies elsewhere at this moment. The 'good' news is I'm running out of work this month so next month I have a lot of spare time. Will do some reading and maybe / probably some lisping too.
  6. @Discus84 Your question reminded me of the time my son asked me if I could determine if the couch he was planning to buy would fit in the frieght elevator of his aprtment building. There are several way to solove this problem. 1. Make multiple copies of the red box at different angles and then position them with object snap against the walls and floor. 2. Use the paramteric feature of AutoCAD to create and constrain the wall and the box. The following image shows only the angle contraint of the box. Tangency to the wall and floor is made via a dimensional contraint. Here's the result of changing the box angle. The following shows the dimensional and geometric constraints. Note, d3 constrains the box to be flush with the back wall and d9 with the floor. You can edit the dimensions in the attached file to meet yout requirements. box fit.dwg
  7. Steven P

    Dynamic variables

    It mentions this in the help file that "Duplicate elements may be eliminated from the list."
  8. There is a LISP around for that. It doesn't work on DIMDIA/DIMRAD, but can really speed up the work if it's an entire drawing. _dimreassociate, is there a quicker way to do an entire drawing? - AutoCAD 2D Drafting, Object Properties & Interface - AutoCAD Forums I have a few newer versions I have been working on to improve it that I don't think are ready for posting, but maybe I will get back at it soon.
  9. SLW210

    Center mark replacement

    Nice one! I am surprised you had time in your 30 hour day to respond. I did get it to work on most objects in AutoCAD 2000i, I'll try to get it working better when I get a chance, I believe the issue is now mostly my AutoCAD 2026 drawings are showing proxy object warnings when I save them down to AutoCAD 2000 versions, so I might try redrawing the tests.
  10. secon

    Bentley ProSteel for AutoCAD

    In 2026, I purchased Bentley ProSteel on the MicroStation platform. I haven't used it yet. I previously used another software package, but its annual subscription fees were excessively high. I decided to switch to ProSteel because it is available with a perpetual license, and its annual maintenance costs are relatively reasonable. I work independently and also need to use several other software packages, which come with additional costs. I haven't started learning ProSteel yet, so I was wondering if anyone could recommend any good-quality training materials, tutorials, or other resources that would help me learn how to use the software effectively. According to the reseller, I am apparently the only person in my country using ProSteel on the MicroStation platform. Tekla Structures and Advance Steel are much more popular here. However, both use subscription-based licensing models, which is why ProSteel became an attractive alternative for me.
  11. EnM4st3r

    Selecting viewport in a lisp

    okay i just tested CABs version more throughly, it does get the correct amount of viewports, however it seems it does not correctly identify the paperspace viewport. From my testing on TrueViewports.dwg its exluding a wanted viewport and including the papserspace vp. I tested it by printing the object handles of the viewports and compared the handles manually. (defun c:test345 () (mapcar '(lambda (l) (list (car l) (mapcar '(lambda (e) (cdr (assoc 5 (entget e)))) (cadr l)))) (cab_foo nil)) ) (defun cab_foo (on? / get_exc ss result vpl tab exc tmp) ;; Only get vps that are ON if flag is true (defun get_exc (vpe / a b c) (and (setq a (cdr (assoc 330 (entget vpe)))) (setq b (cdr (assoc 340 (entget a)))) (setq c (cdr (assoc 331 (entget b)))) ) c ) (if (setq ss (ssget "x" '((0 . "VIEWPORT")))) (progn (setq vpl (mapcar 'cadr (ssnamex ss))) (setq vpl (mapcar '(lambda (x) (cons x (cdr (assoc 410 (entget x))))) vpl)) (setq vpl (vl-sort vpl '(lambda (e1 e2) (< (cdr e1) (cdr e2))))) (foreach vp vpl (cond ((null tab) (setq tab (cdr vp) exc (get_exc (car vp)) ) ) ((= tab (cdr vp)) (if (and (not (= exc (car vp))) (or (not on?) (zerop (logand 131072 (cdr (assoc 90 (entget (car vp)))))))) (setq tmp (cons (car vp) tmp)) ) ) (t (setq exc (get_exc (car vp)) result (if result (cons (list tab tmp) result) (list (list tab tmp)) ) tab (cdr vp) tmp nil ) ) ) ) (if tmp (setq result (if result (cons (list tab tmp) result) (list (list tab tmp)) ) ) ) ) ) result ) (defun c:gethandle () ;gets the handle of the currently activated viewport (and (not acet-currentviewport-ename) (= (load "acetutil.fas" "fail") "fail") (princ "\nError: couldnt load acetutil.fas") ) (cdr (assoc 5 (entget (acet-currentviewport-ename)))) ) test345 gives me: (("Layout2" ("245" "249" "24E" "263")) ("Layout1" ("233" "238"))) The correct handles would be: Layout1: "259", "238" Layout2: "24E", "263", "249", "268" so maybe the only reliable option is to initialize each layout and look for code 69
  12. Alex Brikulsky

    What Is AutoCAD Used For?

    Spot on. For anyone starting out, realizing just how much AutoCAD handles- from initial layouts to final fabrication docs - is a real eye-opener. Thanks for sharing!
  13. EnM4st3r

    Selecting viewport in a lisp

    i think this is the thread with CABs code. https://www.theswamp.org/index.php?topic=10992.0
  14. Great question! This is a classic challenge when working with meshes in AutoCAD. When you increase the smoothness level globally, it acts like a blanket smoothing filter and ruins hard edges. To keep sharp features intact, here are a few approaches depending on the model: Creasing Edges (MESHSMOOTHCREASE): Before increasing smoothness, you can apply creases to specific edges or vertices. This tells AutoCAD to hold those edges sharp even at higher subdivision levels. Selective Refinement: Instead of cranking up the global smoothness for the whole object, try refining only specific faces or sub-objects where smooth transitions are actually needed, leaving critical mechanical features alone. Hybrid Modeling: If precise dimensions and sharp intersections are critical (like for manufacturing components), I usually avoid heavy mesh editing and stick to solid modeling, or convert the final clean shape back to solids using CONVTOSOLID once the organic parts are done. How complex is the geometry you're working on? Are you dealing with mechanical parts or more of an architectural/organic shape?
  15. EnM4st3r

    Selecting viewport in a lisp

    i cannot replicate this. When i first open TrueViewports.dwg "Layout2" is already initialized. Without initializing "Layout1" Running (sslength (ssget "_X" '((0 . "VIEWPORT") (67 . 1) (-4 . "/=") (69 . 1)))) -> i get 7 But running (length (rjp-getvports)) -> i get 6 so at least for me on this test drawing file @ronjonps code seems to work without initializing the layouts.
  16. In large 2D drawings, similar objects such as symbols, equipment layouts, and standard details are often repeated several times. Using blocks makes it possible to update all instances from a single definition, while groups allow objects to be selected and handled together without creating a reusable block definition. Choosing the wrong approach can make later editing and drawing maintenance more difficult. When managing repeated geometry in production drawings, do you prefer blocks or groups? What factors influence your choice?
  17. Even a well-prepared CAD drawing can produce unexpected results when converted into a PDF or printed. Different settings and drafting practices can affect the final output. In your experience, what causes the most plotting problems?
  18. A drawing may look properly organized with different lineweights assigned to layers, but the final PDF or printed output can look completely different. Some lines appear too thick, while others become difficult to distinguish. One possible cause is a mismatch between layer lineweight settings and CTB/STB plot style configurations. The PLOT settings and selected plot style table can override the appearance you expect. When your plotted output doesn't match the drawing display, what do you check first: layer properties, CTB/STB settings, or plot configuration? Have you encountered any less obvious causes?
  19. I agree. A 3D model can help verify the geometry, but a fully dimensioned 2D drawing is still important for manufacturing. Sections and profiles also make it easier to check critical areas, especially on complex parts. I think the right approach depends on how the part will be manufactured and what information the production team needs.
  20. HI, The yellow line is wall, red is a box. I would like to know if the box fits by turning and sliding into opening. I put it into a circle as a bounding box and manually moved it around to check. There must be a more elegant way of doing this and mabe a way to calculate the max height of such box knowing its width and the wall depth with header height. Thanks!
  21. Yesterday
  22. Paul Li

    Selecting viewport in a lisp

    FYI, Your code works fine in your sample dwg because as you loop through each layout the space is already set in pspace. But the code fails when it encounters a layout with a vport set in mspace. The following revised loop segment code accommodates for this: (vl-catch-all-apply '(lambda () (foreach lay (layoutlist) (setvar "CTAB" lay) ; (setvar "CVPORT" 1) ; this will error out if in mspace (setq cvport (getvar "cvport")) ; save current psace vport # (if (> 1 cvport) ; chk if in mspace (progn ; then (vl-cmdf "_.Pspace" "_.ZOOM" "_E" "_.Mspace") ; goto pspace then zoom extent and return to mspace (setvar "cvport" cvport) ; return to mspace of original vport # ) (vl-cmdf "_.ZOOM" "_E") ; else just zoom extent in pspace ) ; if ) ; foreach ) ; lambda
  23. Like @SLW210 I had a move the title block in layouts to 0,0 and then zoom extents, had one user that would move the title block as it was the way he liked to draft. We had auto plot layouts so was part of our company standard to have title at 0,0.
  24. BIGAL

    Dynamic variables

    @PGia there are other ways to sort lists other than inbuilt Vl-sort. You can use a Lisp version of Bubble sort and other sort algorithms. I sort up to 5 items deep in a list and as far as I can tell none are lost. Yes have seen that with some lists using VL-sort. So you can sort on say X & Y. ; sorts on 1st two items (vl-sort lst '(lambda (a b) (cond ((< (car a) (car b))) ((= (car a) (car b)) (< (cadr a) (cadr b))) ) ) )
  25. Paul Li

    Selecting viewport in a lisp

    @DavidP @mhupp as they say...there's more than one way to skin a cat... either with 67 or 410 or go crazy and do both 67 & 410...but the result is the same: vports from Model are filtered out
  26. rlx

    Center mark replacement

    sure : (alert "Press ok to start your 30hr day") anything else I can do for you?
  27. PGia

    Dynamic variables

    @Danielm103 Interesting. I didn't know about those functions or that a parallel namespace existed. I'll look into that. Maybe it will minimize the drawbacks of using dynamic variables. @BIGAL Suppose we're dealing with elements that are scattered over a large area and you need to sort only a part of them and get a list. It might seem that the vl-sort function could be useful for this; however, it has a drawback: sometimes it deletes repeated elements from the list based on the filters. So I'm trying to do it without using vl-sort. Note: There are some objects that match exactly in location with others. @mhupp: Dictionary? What dictionary?
  28. Last week
  29. Danielm103

    Dynamic variables

    AutoCAD session, you need to use vl-bb-set vl-bb-ref right?
  1. Load more activity
×
×
  • Create New...