Leaderboard
Popular Content
Showing content with the highest reputation since 04/02/2026 in all areas
-
in good programming its harder to know when code will fail or do things you don't want. If your ok with turning off all layers that end in -PT. might have some layer that doesn't have points or something. The command might do this already cant test right now but list out all layers that were turned off as a double check. and while command is slower than vla or entmake and has some other quarks its often times simpler/easier to use. as this for example two lines of code vers what i just posted. (defun c:foo ( / doc layers lay name laylist) (vl-load-com) (setq laylist '()) (vla-StartUndoMark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))) (setq layers (vla-get-Layers doc)) (vlax-for lay layers (if (wcmatch (setq name (strcase (vla-get-Name lay))) "*-PT") (progn (setq laylist (cons name laylist)) ;build list of layer names (vla-put-Freeze lay :vlax-true) (vla-put-Off lay :vlax-true) ) ) ) (vla-EndUndoMark doc) (if laylist (progn (princ (strcat "\nLayers frozen and turned off (" (itoa (length laylist)) "):\n")) (foreach n (reverse laylist) (princ (strcat " " n "\n")) ) ) (princ "\nNo Layers Matching *-PT found.") ) (princ) ) You could probably combine those two functions into one using ldata as a toggle between on and off. ill post later tonight.2 points
-
@mhupp Correct it's no longer supported, but the "VLIDE" command and environment still works, at least as of my AutoCAD 2026.2 points
-
You cant freeze\off only the points its either the whole layer or nothing. this makes a selection set and process it to find what layers they are on and turns feezes and turns off those layers. if their are other things on that layer they will also be frozen and off. (defun c:test01 ( / ss lay laylst) (vl-load-com) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq layers (vla-get-Layers doc)) (if (setq ss (ssget "_X" '((0 . "AECC_COGO_POINT") (8 . "*-PT")))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq lay (cdr (assoc 8 (entget ent)))) (if (not (member lay laylst)) (setq laylst (cons lay laylst)) ) ) (foreach lay laylst (setq layerObj (vla-Item layers lay)) (vla-put-Freeze layerObj :vlax-true) (vla-put-Off layerObj :vlax-true) ) (prompt "\nNo matching COGO points found.") ) (princ) )2 points
-
2 points
-
@SLW210 Here you go. https://forum.bricsys.com/discussion/40003/extract-outer-boundary-of-2d-drawing#latest2 points
-
AutoCAD for Windows has more features than AutoCAD for Mac. Compare Features: AutoCAD for Windows against AutoCAD for Mac2 points
-
Oh dear, my mistake. I didn't think it through. It's obvious that objects cant be frozen or turned off so I rewrote and shortened my functions to this: ; Freeze and turn off layers with -PT suffix (defun c:zOff () (command-s "_-layer" "_freeze" "*-PT" "") (command-s "_-layer" "_off" "*-PT" "") (princ) ) ; Thaw and turn on layers with -PT suffix (defun c:zOn () (command-s "_-layer" "_thaw" "*-PT" "") (command-s "_-layer" "_on" "*-PT" "") (princ) ) Now they do exactly what I need them to, but is that foolproof? I tested the function in a drawing that contains at least one of the above mentioned layers and on a drawing that doesn't. No issues, only a message like "no matching layers found". That should be fine. I've read that VL(A(X))-functions are faster, but the code code would be bulky. Do you recommend something different from my code? Best regards1 point
-
I'm assuming its the new Notepad and not the one from 1995. it defaults to copy text with formatting. You have three options. You can change the default font and size in notepad settings, disable formatting also in settings ,or use Ctrl + Shift + V to paste as plain text. there also might be a right click paste as plain text option.1 point
-
much easier to use the coords pastable.. I use them mid command with !pp <prev.point>... and needed to comment line '056'1 point
-
A couple more comments: Collected the defuns together at the top of the routine - easier to spot them that way Used vl-princ-to-string for the coordinates to string, looses the ',' though but the reverse shouldn't need that Added a check that the layer exists before making it new (could be an error) Reset system variables to as they were (eg cmdecho_old) rather than specifying a value Just tidied up the indenting a touch - my ADHD - and added some annotations for closing brackets Do you need to use the selection set for anything else (ss) In the entmakex point, do you need to set 210 ? (defun c:4x (/ *error* pt1 ss ) (vl-load-com) (defun *error* ( msg ) (setvar 'cmdecho 0) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (if msg (prompt (strcat "\n" msg)) ) (setvar 'cursorsize Cursor_Old) ;; reset (setvar 'cmdecho CmdEcho_Old) ;; reset (princ) ) ; end *errror* (defun zPoint ( pt1 / exv) ;; 3d point mfg ;; added pt1, usually better to specify (setq pt1 (trans pt1 1 0)) (setq exv (trans (list 0 0 1) 1 0 T)) (entmakex (list (cons 0 "POINT") (cons 10 pt1) (cons 210 exv) ;; do you need to use 210? )) ; end entmakex, end list ) ; end zpoint (defun cdd ( pt1 / pp) (princ "\n") (setq pp (vl-princ-to-string pt1)) (princ pp) ; (princ ; (setq pp ; (strcat ; (rtos (car pt1) 2 4) "," ;; 'p' -- vertex from pgm /\ getpoint,... ; (rtos (cadr pt1) 2 4) "," ; (rtos (caddr pt1) 2 4) ; ) ; end strcat ; ) ; end setq ; ) ; end princ (princ " cucs ");; ; (entmakex (list (cons 0 "POINT") (cons 10 pt))) ;; clean point (setenv "pp" pp) ;; crash saved coords ) ; end defun cdd (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) ;; Start Undo (if (tblsearch "LAYER" "XLINE") (princ "\nLayer Exists") ;; Layer exist. Do nothing (entmakex '( (000 . "LAYER") (100 . "AcDbSymbolTableRecord") (100 . "AcDbLayerTableRecord") (002 . "XLINE") ;; Layer Name (070 . 0) ;; Layer Status (bit-coded) (006 . "Continuous") ;; Layer Linetype (must be loaded) (062 . 252) ;; Layer Colour (1-255) (290 . 0) ;; Non-Plot Flag (0=Plot, 1=NoPlot) (370 . -3) ;; Layer Lineweight (-3=Default) )) ; end list, end entmakex ) end if layer (princ (strcat "\n 45"(chr 186)"/135"(chr 186)" 3D.XLines <!pp>")) (setq Cursor_Old (getvar 'cursorsize)) (setvar 'cursorsize 1) ;; Get the initial placement point (setq CmdEcho_Old (getvar 'cmdecho)) (setvar 'cmdecho 0) (while (setq pt1 (getpoint "\nSpecify Point for XLines: ")) (progn ;; Create a new empty selection set (setq ss (ssadd)) ;; do you need this if it is a local variable - or is there more code later? ;; Create horizontal xline and add to selection set (command "_.xline" "_a" 45 pt1 "") (command "_.chprop" "_L" "" "_la" "XLINE" "") ;; make xline grey (ssadd (entlast) ss) ;; likewise, do you need this ;; Create vertical xline and add to selection set (command "_.xline" "_a" 135 pt1 "") (command "_.chprop" "_L" "" "_la" "XLINE" "") ;; make xline grey (ssadd (entlast) ss) ;; and this (cdd pt1) ;; post coords (zPoint pt1) ;; point at 'pick.point ) ; end progn ) ;; end of while ;;--reset variables--;; (setvar 'cmdecho CmdEcho_Old) (setvar 'cursorsize Cursor_Old) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) ;; End Undo (princ) ; exit quietly )1 point
-
1 point
-
Suggestions received, posted and updated. As with the coords, the point is a reference entity. Thanks (defun c:4x (/ *error* pt1 pt2 ss ) (princ (strcat "\n 45"(chr 186)"/135"(chr 186)" 3D.XLines <!pp>")) ;; ai: https://www.google.com/search?q=saving+2+lines+selection%2C+autolisp&client=firefox-b-1-e&hs=AnK&sca_esv=3c4c5acec5573df9&biw=1198&bih=593&ei=JazVaZ2GN-3fp84P46_CyAM&ved=0ahUKEwjdrJWQit2TAxXt78kDHeOXEDkQ4dUDCBE&oq=saving+2+lines+selection%2C+autolisp&gs_lp=Egxnd3Mtd2l6LXNlcnAiInNhdmluZyAyIGxpbmVzIHNlbGVjdGlvbiwgYXV0b2xpc3AyBRAAGO8FMgUQABjvBTIFEAAY7wUyCBAAGKIEGIkFSKOCAVDmIlj5PHABeACQAQCYAakBoAHdCKoBAzEuN7gBDMgBAPgBAZgCCaACqAvCAg4QABiABBiwAxiGAxiKBcICCBAAGLADGO8FwgILEAAYsAMYogQYiQXCAgoQIRigARjDBBgKwgIIECEYoAEYwwSYAwCIBgGQBgqSBwUxLjYuMqAHwSSyBwUwLjYuMrgHzwrCBwczLTYuMi4xyAfBAYAIAA&sclient=gws-wiz-serp (vl-load-com) (defun *error* ( msg ) (setvar 'cmdecho 0) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (if msg (prompt (strcat "\n" msg))) (setvar 'cursorsize 100) ;; reset to my prefer (setvar 'cmdecho 1) (princ) ) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) ;; (setvar 'cursorsize 1) (entmakex ;; <LM '( (000 . "LAYER") (100 . "AcDbSymbolTableRecord") (100 . "AcDbLayerTableRecord") (002 . "XLINE") ;; Layer Name (070 . 0) ;; Layer Status (bit-coded) (006 . "Continuous") ;; Layer Linetype (must be loaded) (062 . 252) ;; Layer Colour (1-255) (290 . 0) ;; Non-Plot Flag (0=Plot, 1=NoPlot) (370 . -3) ;; Layer Lineweight (-3=Default) ) ) (defun zPoint ( / exv) ;; 3d point at xline _mid (not on 'xline layer) (setq pt1 (trans pt1 1 0)) (setq exv (trans (list 0 0 1) 1 0 T)) (entmakex (list (cons 0 "POINT") (cons 10 pt1) (cons 210 exv))) ) (defun cdd () (princ "\n") (princ (setq pp ;; make/prints coords & paste usable (strcat (rtos (car pt1) 2 4) "," ;; 'p' -- vertex from \/ getpoint (rtos (cadr pt1) 2 4) "," (rtos (caddr pt1) 2 4) ) ) ) (princ " cucs ");; (setenv "pp" pp) ;; crash saved coords in reg ) ;;// ----------------------------------------------------------------------------------------------------------- ;; Get the initial placement point ;; (while (setq pt1 (getpoint "\nSpecify Point for XLines: ")) (setvar 'cmdecho 0) (progn ;; Create a new 'usable' empty selection set (setq ss (ssadd)) ;; Initialize an empty set: ;; Create horizontal xline and add to selection set (command "_.xline" "_a" 45 pt1 "") (command "_.chprop" "_L" "" "_la" "XLINE" "") ;; make xline grey (ssadd (entlast) ss) ;; adds 'xline to empty 'ss selection set ;; Create vertical xline and add to selection set (command "_.xline" "_a" 135 pt1 "") (command "_.chprop" "_L" "" "_la" "XLINE" "") ;; make xline grey (ssadd (entlast) ss) ;; adds another 'xline to 'ss selection set (cdd) ;; post coords of 'pick.point (zPoint) ;; point at 'pick.point ) (setvar 'cursorsize 100) ;; reset to my prefer (setvar 'cmdecho 1) ) ;; end of while (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (*error* nil) (princ) )1 point
-
Ah looking it up you have to set the following https://help.autodesk.com/view/ACDLT/2026/ENU/?guid=GUID-1853092D-6E6D-4A06-8956-AD2C3DF203A3 (setvar 'LISPSYS 0)1 point
-
@ScottMC I don't see any functional problems with it, other than as Nikon said, you should use the "_." before commands, even though they are not strictly necessary. FYI - The "." (dot) ensures the actual AutoCAD command is used, in case it has been redefined, and the "_" (underscore) allows the command and any options within it to be used in any localized language version of AutoCAD. Example in your routine: (command "_.chprop" "_L" "" "_la" "XLINE" "") Additionally: 1) You should also reset your "cursorsize" variable at the end of the routine: (setvar 'cursorsize 100) 2) You are resetting an undo mark in your error routine, and you never included a starting undo mark, i.e. (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) at the beginning of the routine. 3) Your routine or file should have (vl-load-com) if you use the Visual LISP ActiveX functions in #2 above. 4) You don't need a (progn ...) statement within a (while) loop. (Added) That being said. I cannot properly test the purpose of the "zpoint" function without knowing in what context you are using it, i.e. a sample drawing situation to test with? Otherwise I don't really understand your purpose for it.1 point
-
I probably you need to add (_) before "off" (Command "_.-Layer" "_off" lay "") ??? I don't have the "_FREEZE" command in Autocad 2021. (Unknown "_FREEZE" command). But there is a command "_.LAYFRZ". To test the command, type "_FREEZE" on the command line.1 point
-
@mhupp did you look at my comment about the labels being at incorrect distance ? At the start they are correct and further along seem to have been shifted. A lot appear to have same incorrect offset. @pmadhwal7 I just made the blocks 1 unit long, just used BEDIT scale by 0,1 "0,0" then scale will be correct also turned off osnap. General comment given the chainage of the first label, 250414 the start of the pline is 250305, in label terms. Why is this start point not like 250300 which would make a lot more sense. Have used other pick label to set start chainage when testing. @pmadhwal7 need to know how are these labels being generated to a dwg.1 point
-
Ok just ran all 488 values and there may be a problem in your sample dwg the Chainage labels are not at correct chainage compared to the start point. I looked and the block did not align properly so checked the distance from start point for a random label and the blocks inserted are at the chainage but your label is not. The blue line is a circle with the radius set to the correct chainage you can see goes through middle of block but label does not match. So here is some code, note the blocks have been made 1 unit in length. I also changed the Excel to work out the mid point yes can be done with lisp but really why not use Excel. The dwg attached shows the problem. The Excel I used is attached. Yes part two needs to be done but need some answers to what I see as lots of problems in future dwg's. Drawing1-test.dwg test.lsp Book1.xlsx1 point
-
1 point
-
My 5 cent (defun c:LLD () (c:LayerLegend)) (defun c:LayerLegend ( / df i l ln p1 pt sp DSC ENT NM ) ;; Lee Mac 2011 (vl-load-com) (if (and (setq pt (getpoint "\nSpecify Point for Legend: ")) (setq ln (* 100 (getvar 'TEXTSIZE))) ;(getdist "\nSpecify Length of Lines: " pt)) (setq pt (trans pt 1 0)) (setq i -1) (setq sp (* 2.5 (getvar 'TEXTSIZE))) ) (while (setq df (tblnext "LAYER" (null df))) (if (/= 16 (logand 16 (cdr (assoc 70 df)))) (setq l (cons (cdr (assoc 2 df)) l)) ) (setq l (acad_strlsort l)) )) (foreach n l (setq ent (vlax-ename->vla-object (tblobjname "LAYER" n))) (setq dsc (vlax-get-property ent 'Description)) (setq nm (vlax-get-property ent 'name)) (setq lc (itoa (vla-get-color ent ))) (entmakex (list (cons 0 "LINE") (cons 8 n) (cons 6 "ByLayer") (cons 62 256) (cons 10 (setq p1 (polar pt (* 1.5 pi) (* (setq i (1+ i)) sp))) ) (cons 11 (polar p1 0. ln)) (cons 370 -1) ) ) (entmakex (list (cons 0 "TEXT") ;*** (cons 1 (strcat n " : " lc " : " dsc)) ;* (the string itself) (cons 6 "BYLAYER") ; Linetype name (cons 7 (getvar 'TEXTSTYLE)) ;* Text style name, defaults to STANDARD, not current (cons 8 n) ; layer (cons 10 p1) ;* First alignment point (in OCS) (cons 11 p1) ;* Second alignment point (in OCS) (cons 39 0.0) ; Thickness (optional; default = 0) (cons 40 (getvar 'TEXTSIZE)) ;* Text height (cons 41 1.0) ; Relative X scale factor, Width Factor, defaults to 1.0 (cons 62 256) ; color (cons 71 0) ; Text generation flags (cons 72 0) ; Horizontal text justification type (cons 73 1) ; Vertical text justification type (cons 210 (list 0.0 0.0 1.0)) (cons 370 -1) ))) (princ) )1 point
-
Not sure for ZWCAD, but it Tamil font installed on your computer, you should be able to access it if it is1 point
-
As I mentioned already, AutoCAD Architecture is FREE with the Toolset. All you need to do is download it. Architecture Toolset in Autodesk AutoCAD | Features This looks like something Bricscad should incorporate as well. That's the reason I stopped working on the LISP, but I will probably try to get it finished up anyway.1 point
-
Like @SLW210 I think you would be better off with a Windows Intel PC. Other CAD software that has MAC software is often reported as having niggly problems. Until there is a true MAC OS based say Autocad those problems may continue, in saying that there are some true MAC CAD programs out there. Autocad MAC has existed for like 30 years and still no true native version.1 point
-
You have to purchase Civil 3D, Architecture is free with AutoCAD. OP still hasn't stated what CAD they are using.1 point
-
$119 USD, you get 15 day free trial. Most examples didn't show gaps, but looks like the user guide claims Auto Tolerance and Auto island detection. Could you link the discussion on Bricscad for the OP?1 point
-
I think this is the product BIGAL was referring to.https://engenext.com/pages/egboundary.html I have no affiliation to this product, I just remember seeing it discussed on the Bricscad forum.1 point
-
@SLW210 CIV3D has Shrinkwrap also. Pity they did not include for plain Acad. If you can work out which dll or ARX may be able to copy correct files to plain Acad. As "TotalBoundary " is no longer available there was a post for a similar product may have been here or at Forums/Autodesk. I remember asking how much but did not get an answer. Try googling.1 point
-
I think I have a solution but would need a test drawing.1 point
-
I did find this... Lisp to create a boundary around blocks that are not touching. - AutoLISP, Visual LISP & DCL - AutoCAD Forums I should have also mentioned that AutoCAD Architecture FREE toolset has the AECLINEWORKSHRINKWRAP command.1 point
-
I had to stop on the newer version yesterday due to my "paid" for work, still debugging it. Can you post an actual .dwg of that example for testing? Also, what version of AutoCAD are you using?1 point
-
I updated something that makes multiple boundaries but cant find the post right now. doesn't work with gaps so idk if its something you could use. lee mac has an outline but also don't think it works with gaps. https://lee-mac.com/outlineobjects.html1 point
-
This is sad news and a little concerning that no explanation is being given. On the face of it, it looks like a complete disregard for the community - I hope that's not true. What is true is that community engagement on forums like this has declined in recent years. Some of that decline is a result of AI. I know that this site has been scraped by LLM bots and, as a result, people seeking answers don't need to visit the site if an AI agent can provide the answer. Just to let you know, I have no intention of closing or suspending this forum any time soon.1 point
-
I use polar tracking and osnaps in AutoCAD. Looks like nanoCAD has similar... Precision tools. Object Snap tracking mode. Download CAD software1 point
-
take a look at this : https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-DD9B3216-A533-4D47-95D8-7585F738FD751 point
-
Like @CyberAngel if you set your osnap to what you want then type "Osmode" a number will appear that is current osnaps settings. Ok part two in say chx you can add this code. Note 1 is End. 0 is off. Normal drafting for me is 47. Try it (setvar 'osmode 47) then type osnap. For say a circle use 4. put at start (setq oldsnap (getvar 'osmode)) (setvar 'osmode 1) .... code put at end (setvar 'osmode oldsnap)1 point
-
Hi guys, I've created an AutoLisp app which creates a cross section of the 3D terrain grid. The terrain can consists of raw AutoCAD entities: MESH / POLYFACE MESH / POLYGON MESH (one or more, even combined). As an author, I will be grateful for any comment, especially suggestions for improvements and developments. Andrej Skvarca TERRAIN_CROSS_SECTION.fas1 point
