All Activity
- Today
-
paste object multiple times in insertion point of selected blocks (or to any objects that has insertion snap)
mhupp replied to james9710's topic in AutoLISP, Visual LISP & DCL
Had this laying around sounds like what you want to do. used it mostly on circles but will work on any entity. it calculates the mid point so might want to replace line 8 - 11 with just a getpoint. COB.lsp -
riobebe joined the community
-
olocart joined the community
-
How big is your printer? Sound like you have PSLTSCALE turned off.
-
Glad you got it working, a good idea is post code so we my help improve it.
-
AutoLISP Programming with Visual Studio Code & Notepad++
BIGAL replied to Iftikhar Arain's topic in AutoLISP, Visual LISP & DCL
I use Notepad++ and it has a plugin for ActiveX which allows you to run the lisp code in Autocad, whilst testing etc. You can set language to lisp so it does color changing of the code as well as bracket checking. I use Bricscad now so the Active X stopped working so I often use Cut and paste to command line. But I have been programming for like 40 years so understand how to do that. -
paste object multiple times in insertion point of selected blocks (or to any objects that has insertion snap)
BIGAL replied to james9710's topic in AutoLISP, Visual LISP & DCL
It is probably best to post some sort of sample dwg so we can see what it is your trying to do. - Yesterday
-
teresa k joined the community
-
jodie102 joined the community
-
"With the calculation of weight, it becomes more complicated." Fields can have formulas so you can get area and * weight.
-
Possible 2 problems you can not use a variable name of "t" this is interpreted as the system variable TRUE, use say Tval. The other is Mtext may be a better way to go. (command "_mtext" p13 p13 (strcat "RISER " (rtos rh 2 3) "\n" "TREAD " (rtos tval 2 3)))
-
LISP that selects all overlaping lines
masterfal replied to Anders M's topic in AutoLISP, Visual LISP & DCL
i ran it on this tiny drawing and didnt seem to work properly.. OVERLAPPING LINES.dwg -
Eifageme joined the community
-
Set Scale lisp - Help with an error
betterway replied to mhy3sx's topic in AutoLISP, Visual LISP & DCL
Added the command line to zoom scXP and it worked ! Was not able to use a variable for the zoom command so used if-statements to enter the text needed for each scale. -
AutoLISP Programming with Visual Studio Code & Notepad++
GLAVCVS replied to Iftikhar Arain's topic in AutoLISP, Visual LISP & DCL
Hello If you want to program in lisp it is better to do it from the Visual Lisp IDE. To open it, simply write on the command line: vlide And press ENTER -
haoanhnguyen joined the community
-
Mohamed Rawatan joined the community
-
when on the layout page, we set the scale back to 1:1 with nothing selected so that the x-referenced drawings will show correctly, i.e. dashed lines, hatching, etc. this does not change the scale of the viewports which are sometimes set to 1/4 or 1/8 scale. on our shortcut commands it says "setup 1:1", not sure if that helps.
-
Iftikhar Arain started following AutoLISP Programming with Visual Studio Code & Notepad++
-
AutoLISP Programming with Visual Studio Code & Notepad++
Iftikhar Arain posted a topic in AutoLISP, Visual LISP & DCL
I am currently learning AutoLISP programming. I am using Notepad but would like to switch to Visual Studio Code or Notepad++. I tried to find tutorial videos on YouTube but couldn’t find any. I have installed Visual Studio Code with the AutoLISP extension and Notepad++, but I am still struggling to run any programs. Can anyone please explain how to use these code editors for AutoLISP programming or provide links to tutorial videos on YouTube? -
OK, which scale did you mean?
-
X-REFs not aligning...(super strange bug?)
GPK replied to GPK's topic in AutoCAD 2D Drafting, Object Properties & Interface
I had not thought of that and will keep it in mind if the problem persists however, it seems to have resolved itself after re-attaching it today. I suspect its a buggy drawing. Thank you for the lead, I'll be checking this in the future as well! -
X-REFs not aligning...(super strange bug?)
GPK replied to GPK's topic in AutoCAD 2D Drafting, Object Properties & Interface
We just re-opened the main drawing to check this (thank you for the suggestion, I didn't know about this) and this misbehaving utility drawing was attached but not showing at all, layers thawed and unfrozen and zoomed extents an everything... After checking INSBASE in the main and util drawing we reattached it and it came in fine. I suspect its just a buggy drawing. Thank you again, I will be checking this variable from now on. -
I see the viewport scale set to 1:1. My mistake, I should have clarified that I want to set the overall sheet scale to 1:1 and not change the viewports. Thanks for the info. I will work with what you have shown.
-
Steven P started following editing a macro
-
Copied and pasted from my Lisp Library: The first are useful functions to have to hand. For example "ZA" - Zoom All I use all the time in preference to "Zoom" "All" "Closer" closes document, no save "VPScale" sets all viewports to 1:1 scale in that sheet Put together in MyClose at the end. Load them all up and it should be OK ;;;;SubFunctions, Useful to have anyway;;;; ;;;;Zooms: ZE - extents, ZA - All, ZO - Object, ZP - Previous (defun c:ze() ;;Zooms extents, then zooms out 0.95x (command "zoom" "e" "zoom" ".95x")(princ) ) (defun c:za() ;;Zoom all, then zooms out 0.95x (command "zoom" "a" "zoom" ".95x")(princ) ) (defun c:zo() ;;Zoom object (command "zoom" "o" "zoom" "0.95x")(princ) ) (defun c:zp() ;;Zoom previous (command "zoom" "p")(princ) ) ;;;;asave: Save Lisp (defun c:asave( / currentversion saveasversion old) (setq vars '("CMDECHO" "FILEDIA")) ;;Disable command promts and echo vars (setq old (mapcar 'getvar vars)) ;;Record current vars (mapcar 'setvar vars '(0 0)) ;; Change vars (if (= 1 (getvar "dwgtitled"))(command "qsave")) ;; EXISTING DRAWING (if (= 0 (getvar "dwgtitled")) (COMMAND "_.saveas" "" "~") ) ;;new drawing (mapcar 'setvar vars old) ;;reset command prompt and echo (princ) ) ;;;;closer: Closes drawing, no save (defun c:closer( / *doc* opendrawings) (if (= dbmod 0)(command ".close")) ;; Close if drawing is saved (if (/= dbmod 0)(command ".close" "y")) ;; Close if drawing is not saved ) ;;;; VPScale: Sets all viewports in sheet to 1:1 (defun c:VPScale ( / MySS scale acount) (setq MySS (ssget "_X" '((0 . "VIEWPORT")))) ;; Select all viewports (setq acount 0) ;; A counter (setq scale 1) ;;1 = 1:1 ;; Scale to use (while (< acount (sslength MySS)) ;; loop through selection set (vla-put-customscale (vlax-ename->vla-object (ssname MySS acount)) scale) ;; Set viewports scales (setq acount (+ acount 1)) ) ; end while ) ;;;;; End sub routines ;;;;; ;;;;Zoom extents, all viewports to 1:1, save, close (defun C:MyClose ( / LayList CurrentLay Lay) (setq LayList (layoutlist)) ;; Get layout List (ACAD 2023+) (setq CurrentLay (getvar "ctab")) ;; Record current layout (foreach Lay LayList ;; Loop through each layout (setvar "ctab" Lay) ;; Change layout (c:ZE) ;; Run ZE: Zoom Extents (above) (c:vpscale) ;; Run VPScale, set all viewports to 1:1 ) ; end foreach ;; End loop (setvar "ctab" CurrentLay) ;; Return to previous sheet (c:asave) ;; Save (c:closer) ;; Close )
-
Imron ROsyadi joined the community
-
Tharwat started following Routine or method to generate a length X width from existing dimensions.
-
Routine or method to generate a length X width from existing dimensions.
Tharwat replied to 70melbatoast's topic in AutoLISP, Visual LISP & DCL
You need just to work on the formatting of the Mtext to get it the way you want it. -
Enable osnap in LM:GrText program
GLAVCVS replied to ehsantavassolian's topic in AutoLISP, Visual LISP & DCL
I'm glad to know that it is useful to you. -
wedare joined the community
-
Find the total sum of hatch areas for different layers
Nikon replied to ysf's topic in AutoLISP, Visual LISP & DCL
-
Find the total sum of hatch areas for different layers
GLAVCVS replied to ysf's topic in AutoLISP, Visual LISP & DCL
I edited something at the last minute. You may need to copy the code again -
Find the total sum of hatch areas for different layers
Nikon replied to ysf's topic in AutoLISP, Visual LISP & DCL
-
Find the total sum of hatch areas for different layers
GLAVCVS replied to ysf's topic in AutoLISP, Visual LISP & DCL
(defun c:hatcharea-GL1 (/ ss area i eo pt lst layer lstLayers color) (setq ss (ssget '((0 . "hatch"))) area 0 i 0 ) (cond ((and (and ss) (> (sslength ss) 0)) (repeat (sslength ss) (setq eo (vlax-ename->vla-object (ssname ss i))) (setq area (vlax-get eo 'Area) layer (vlax-get-property eo "LAYER") ) (if (setq lst (assoc layer lstLayers)) (setq lstLayers (subst (list layer (+ (cadr lst) area)) lst lstLayers ) ) (setq lstLayers (append lstLayers (list (list layer area)))) ) (setq i (+ i 1)) ) (if (= (setq color (vlax-get-property eo "COLOR")) 256) (setq color nil) ) (foreach layer lstLayers (if (setq pt (getpoint (strcat "\nInsertion point for area HATCHs in layer \'" (strcase (car layer)) "\'" ) ) ) (progn (setq area (cadr layer)) (setvar "CECOLOR" "BYLAYER") (command "_.STYLE" "Standard" "" 2 "" "" "" "") (command "_.text" pt 0 (strcat "Area = " (rtos area 2 2)) "" ) (command "_.STYLE" "Standard" "" 0.2 "" "" "" "") (vla-put-layer (vlax-ename->vla-object (entlast)) (car layer)) (if color (vla-put-color (vlax-ename->vla-object (entlast)) color) ) ) ) ) ) ) (princ) ) -
Shewa joined the community
-
Hi, can anyone help me to create a lisp with the following requirement: I will copy any object with basepoint (lets say a circle, copy with basepoint at center), then paste it at the insertion point of selected blocks. or simply to say, paste object multiple times in insertion point of selected blocks (or to any object that has insertion snap)
-
Find the total sum of hatch areas for different layers
Nikon replied to ysf's topic in AutoLISP, Visual LISP & DCL
error: no function definition: VLAX-PUT-LAYER