All Activity
- Today
-
I agree, then there will be another version.: ;; Rectangle on the non-printable "LayDef" layer, LWEIGHT 0.5, color 2 yellow ;; Based on the Lee Mac code 02.10.2025 (defun c:RectLayDef_N ( / cec cel cla ) (setq cec (getvar 'cecolor)) (setvar 'cecolor "2") (setq cel (getvar 'celweight)) (setvar "celweight" 50) (setq cla (getvar 'clayer)) (command "_.-LAYER" "_M" "LayDef" "_C" 2 "LayDef" "_LW" 0.50 "LayDef" "_P" "_N" "LayDef" "") (setvar 'clayer "LayDef") (initcommandversion) (vl-cmdf "_.rectang") (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\")) (setvar 'cecolor cec) (setvar 'celweight cel) (setvar 'clayer cla) (princ) )
-
willsmithusa7045 joined the community
-
Blocks: change nested object color to "by block" (but main block color remains "by layer")
votuanh replied to hpimprint's topic in AutoLISP, Visual LISP & DCL
It worked successfully. But I need ctrl + z to get true results. Because it was run automatically this code: "Change ByBlock to ByLayer? [Yes/No] <Yes>:". If you have time, please edit code to fix this. I run on autocad 2021. Thank you -
Working with point cloud data in AutoCAD
SLW210 replied to Amuthan1121's topic in AutoCAD Drawing Management & Output
I renamed your thread, please use descriptive titles. -
helpguide joined the community
-
You should avoid using Defpoints layer, Defpoints layer in AutoCAD is automatically created when dimensions are added and is intended to hold definition points for those dimensions. While some users may place objects on this layer to prevent them from printing, it is generally not recommended as it can lead to unexpected issues in the drawing. Create a new no plot layer instead and use that.
-
For those who don't like clouds Sometimes you need to highlight something and you can forget that the frame needs to be deleted. ;; Rectangle on the Defpoints layer, LWEIGHT 0.5, color 2 yellow ;; Based on the Lee Mac code (defun c:RectLayDefcol2 ( / cec cel cla ) (setq cec (getvar 'cecolor)) (setvar 'cecolor "2") (setq cel (getvar 'celweight)) (setvar "celweight" 50) (setq cla (getvar 'clayer)) (command "_.-LAYER" "_M" "Defpoints" "") (initcommandversion) (vl-cmdf "_.rectang") (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\")) (setvar 'cecolor cec) (setvar 'celweight cel) (setvar 'clayer cla) (princ) )
-
-
Another using radio buttons. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (ah:butts but "V" '("Choose a Scale" "1:10" "1:20" "1:50" "1:100" "1:200" "1:250" "1:500" "1:1000"))) ; ans holds the button picked as an integer value or Multi radio buttons.lsp
-
mhupp started following add new scale to list...
-
Shout out to @alanjt for doing the heavy lifting here. This will generate a temp DCL Menu with a list provided and whatever you pick will change the scale accordingly. could be cleaned up a bit with error handling of making sure you selected a viewport or if your in an active viewport pick that one by default. ;;----------------------------------------------------------------------------;; ;; Generates DCL Menu for user to select a veiwport Scale (defun C:VPS () (C:VPSCALE)) (defun C:VPSCALE (/ lst vp) (vl-load-com) (setq Doc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark Doc) (setq lst '("1:1" "1:5" "1:10" "1:15" "1:20" "1:30" "1:40" "1:50" "1:60" "1:70" "1:80" "1:90" "1:100")) ;update list how you see fit (if (setq vp (car (entsel "\nSelect viewport: "))) (progn (setq vp (vlax-ename->vla-object vp) scl (AT:ListSelect "Set Viewport Scale" "Pick A Scale" 30 60 "False" lst) X (substr scl 3) ) (vla-put-CustomScale vp (/ 1.0 X)) (vla-Regen Doc acAllViewports) ;might not be needed (princ (strcat "\nViewport scale set to " scl)) ) ) (vla-endundomark Doc) (princ) ) ;;----------------------------------------------------------------------------;; ;; Function to Pick form list ;; Alan J. Thompson, 09.23.08 / 05.17.10 (rewrite) ;; (AT:ListSelect "Title" "Lable" Height Width "true/false multi select" lst) ;; some coding borrowed from http://www.jefferypsanders.com (thanks for the DCL examples) (defun AT:ListSelect (title label height width multi lst / fn fo d f) (setq fo (open (setq fn (vl-filename-mktemp "" "" ".dcl")) "w")) (write-line (strcat "list_select : dialog { label = \"" title "\"; spacer;") fo) (write-line (strcat ": list_box { label = \"" label "\";" "key = \"lst\";") fo) (write-line (strcat "allow_accept = true; height = " (vl-princ-to-string height) ";") fo) (write-line (strcat "width = " (vl-princ-to-string width) ";") fo) (write-line (strcat "multiple_select = " multi "; } spacer; ok_cancel; }") fo) (close fo) (new_dialog "list_select" (setq d (load_dialog fn))) (start_list "lst") (mapcar (function add_list) lst) (end_list) (setq item (set_tile "lst" "0")) (action_tile "lst" "(setq item $value)") (setq f (start_dialog)) (unload_dialog d) (vl-file-delete fn) (if (= f 1) ((lambda (s / i s l) (while (setq i (vl-string-search " " s)) (setq l (cons (nth (atoi (substr s 1 i)) lst) l)) (setq s (substr s (+ 2 i))) ) (reverse (cons (nth (atoi s) lst) l)) ) item ) ) )
- Yesterday
-
GONZALOAVINA joined the community
-
leonucadomi started following add new scale to list...
-
hello: I'm trying to make a routine that adds new scale to my viewports I want the routine to only ask me a scale number. example . 20 and it generated the scale 1:20 and so on for others I started with this code but something happens and it doesn't work (defun c:EVP3 (/ ESC ESC2) (setq old_err *error*)(defun *error* ( a / )(princ "") (setq *error* old_err)(princ)) (setvar "cmdecho" 0) (setq ESC (getreal "\nIndica la escala: ")) (setq ESC2 (strcat "1" ":" ESC)) (command "_-SCALELISTEDIT" "A" ESC2 ESC2 "E") (princ) );fin defun enlighten me masters ... please thanks
-
You can put the prompts in the getpoint. Note the \n this is make a new line on command prompt. (prompt "Specify the first point of the rectangle: ") (setq p1 (getpoint)) (prompt "Specify the opposite point of the rectangle: ") (setq p2 (getcorner p1)) ; *** rlx (setq p1 (getpoint "\nSpecify the first point of the rectangle: ")) (setq p2 (getcorner p1 "\nSpecify the opposite point of the rectangle: ")) ; *** rlx
-
Just be aware a 3dface is normally 4 points, making a 3dpoly with 3 sides is a different object so import to CIV3D etc may not work without extra steps.
-
I use Bricscad and it found an open Access, maybe some one else with ACAD can check. (setq Access (vl-catch-all-apply 'vlax-get-or-create-object '("Access.Application"))) (vlax-put-property Access 'Visible :vlax-true)
-
Lee Mac started following Rectangle-Revcloud show the frame
-
Another - (defun c:rectrevclcol ( / cec ) (setq cec (getvar 'cecolor)) (setvar 'cecolor "2") (initcommandversion) (vl-cmdf "_.revcloud" "_a" 500 "_r") (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\")) (setvar 'cecolor cec) (princ) )
-
Super! Right in the bull's-eye! Thanks! **** (defun c:RectRevClCol (/ p1 p2 ssRect ssCloud) (prompt "Specify the first point of the rectangle: ") (setq p1 (getpoint)) (prompt "Specify the opposite point of the rectangle: ") (setq p2 (getcorner p1)) ; *** rlx (command "_.RECTANGLE" p1 p2) (setq ssRect (ssget "_L")) (if ssRect (progn (command "_REVCLOUD" "_Object" ssRect "" "_ArcLength" "500" "") (setq ssCloud (ssget "_L")) (if ssCloud (command "_.CHPROP" ssCloud "" "_Color" "2" "") ) ) ) (princ) )
-
rlx started following Rectangle-Revcloud show the frame
-
or instead of using (setq p2 (getpoint p1)) try (setq p2 (getcorner p1))
-
Steven P started following Rectangle-Revcloud show the frame
-
Might have to study GrRead and GrDraw to do that.
-
I would like to see the frame when drawing the rectangle, as in the standard autocad command. If you only call the RECTANGLE command without passing points to it, then AutoCAD will enable the standard interactive construction. If you remove from the line (command "_.RECTANGLE" p1 p2) p1 and p2 (command "_.RECTANGLE"), then the code does not work further, that is, the cloud is not drawn. (defun c:RectRevClCol (/ p1 p2 ssRect ssCloud) (prompt "Specify the first point of the rectangle: ") (setq p1 (getpoint)) (prompt "Specify the opposite point of the rectangle: ") (setq p2 (getpoint p1)) (command "_.RECTANGLE" p1 p2) (setq ssRect (ssget "_L")) (if ssRect (progn (command "_REVCLOUD" "_Object" ssRect "" "_ArcLength" "500" "") (setq ssCloud (ssget "_L")) (if ssCloud (command "_.CHPROP" ssCloud "" "_Color" "2" "") ) ) ) (princ) )
-
Have you tried CadTools?
-
Hi I found a solution, started my hollidays, and forgot to post here. SORRY! @BlackBox, I think you misunderstood. The problem is that if you try to open another application from AutoCAD Lisp code on the same PC (not on another PC, nor with another user: I'm the only user on my PC), administrator privileges are likely required. @BIGAL vlax-get-or-create-object doesn't seem to be able to control an already running application. At least I couldn't do it with an already open Access instance. In the end, I resigned myself to the idea that it's not possible to control a running Access instance and just considered creating a new instance. Thanks everyone for the help.
- Last week
-
Another option: Keeping the original entity and removing any repeated points along the 3D polyline. (defun supriPts3DPol (e / l p lp vlae) (setq vlae (vlax-ename->vla-object e)) (while (/= (cdr (assoc 0 (setq l (entget (setq e (entnext e)))))) "SEQEND") (if (not (equal (setq p (cdr (assoc 10 l))) (car lp) 1e-4)) (setq lp (cons p lp))) ) (vlax-put vlae 'Coordinates (apply 'append (mapcar '(lambda(p) (mapcar 'float p)) lp))) )
-
Amuthan1121 joined the community
-
Working with point cloud data in AutoCAD
Amuthan1121 posted a topic in AutoCAD Drawing Management & Output
I am working with point cloud data in AutoCAD and facing difficulty cleaning unnecessary points. When using crop or section tools in top view, the ceiling and floor points also get removed. Is there a way to create a true limit box, similar to Trimble RealWorks, that allows selective cleaning?, i can only use autocad, it is a assignment -
ADASDASD joined the community
-
mhupp started following switch to turn on or off a variable
-
switch to turn on or off a variable
mhupp replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
Another way not as compact but a little easier to read/follow. Would also handle if uscfollow wasn't 1 or 0 Tho i don't know when/if that would ever happen. ;; Toggle UCSFOLLOW using COND (defun c:foo (/ v) (setq v (getvar "UCSFOLLOW")) (cond ((= v 1) ;; If it's currently ON turn it OFF (setvar 'UCSFOLLOW 0) (princ "\nUCSFOLLOW Desactivado") ) ((= v 0) ;; If it's currently OFF turn it ON (setvar "UCSFOLLOW" 1) (princ "\nUCSFOLLOW Activado") ) (T ;; If it’s some unexpected value, default to OFF (setvar "UCSFOLLOW" 0) (princ "\nUCSFOLLOW Desactivado") ) ) (princ) ) -
sferreira_pcts.pt joined the community
-
Modify and Duplicate Objects in AutoCAD: Autodesk Foundations
The AutoCAD Blog posted a topic in AutoCAD Blogs
When working in AutoCAD, you’ll likely modify or duplicate objects more often than create new ones. To modify and duplicate objects, AutoCAD offers a wide range of options to select objects, giving you the flexibility to meet your needs. Today, we’ll look at a few ways to select, modify and duplicate objects. For the full tutorial, check out the AutoCAD Foundations article. Let’s start with a few quick tips to get you started. How to Select Multiple Objects First things first! You’ll need to select objects before you can modify or duplicate them. You can select multiple objects in an area by clicking an empty location (#1 in image), moving your cursor right or left, and then clicking a second time (#2 in image ). Based on the direction you select objects, you define a crossing or window selection. With a crossing selection, any objects within or touching the green area (in image below) are selected. With a window selection, only the objects completely contained within the blue area (also illustrated in image below) are selected. How to Erase Objects in AutoCAD As a design evolves, some objects that were previously added may no longer be needed. To remove an object, first select it by positioning the pickbox over the object and clicking. The pickbox appears at the center of the crosshairs when no command is active, or as a simple square cursor when a command is active and you’re being prompted to select objects. When objects are selected, they form a selection set, which is the group of objects that will be removed. Quick Tip: The most recently erased objects can be restored with the OOPS command. So if you created or modified any objects after erasing objects, those erased objects can be restored without undoing other recent changes. How to Move Objects in AutoCAD Moving objects in a drawing is one of the most basic ways to modify objects. Simply select the objects to be moved and then specify a base point followed by a second point to determine the distance and direction of the move. How to Duplicate Objects in AutoCAD You will often want to duplicate and reuse elements of your design. To do this, follow the same steps used to move objects: select the objects you want to duplicate, then specify two points to define where the new objects should be created. Advance to New Levels This just scratches the surface of selecting, modifying, and duplicating objects in AutoCAD. Get to the next level by learning how to rotate and scale; offset; mirror; trim and extend; fillet and chamfer; stretch; and more in the AutoCAD Foundations: Select, Modify, and Duplicate Objects article. The post Modify and Duplicate Objects in AutoCAD: Autodesk Foundations appeared first on AutoCAD Blog. View the full article -
there are lots of cases in which source civil 3D files are not given . then recalculating and updating the tables will be like a nightmare.
-
nike497 joined the community
-
GAVAD NORY joined the community
-
ahsattarian28 joined the community
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I thought that perhaps I explained poorly about the reason why my code needs to be loaded before the Lisp commands it must monitor: THE PURPOSE. If the purpose is to identify which commands have been used in order to remember in the future which files need to be loaded, it makes no sense to remember commands such as DDSELECT, SAVEALL, PSTSCALE, BCOUNT, BURST ... etc. that AutoCAD always loads by default. That is, the only ones that need to be remembered are those that the user loaded and used at their own discretion. To distinguish between the two, it is considered that the symbols returned by atoms-family at the moment the code is loaded are AutoCAD’s default ones, which should not be monitored. All the other symbols that do not appear in that initial "snapshot" WILL BE MONITORED. In this way, by saving only the custom commands, it will be more feasible to complement this tool with another one that searches for and loads those commands from a predetermined directory that the user designates for that purpose.