Search the Community
Showing results for tags 'script command lisp'.
-
Using local variables with open command script
Shady_Potato posted a topic in AutoLISP, Visual LISP & DCL
Greetings, Im working on a test lisp to see if I can automate binding an existing xref & converting a bounded block reference back into an xref. while I was able to automate bind, I realized the express tool (-blocktoxref) is incompatible with lisp as it cant seem to find the command. Then I created a script that allows me to set up an open command, but I cant seem to use my local variables (BLKNAME & NEWFILEPATH) with the script command. So my question is, Is it possible to write a script via lisp? and if so how? (defun c:ws_Layer_copy () (vl-load-com) (setq en (ssget "x" '((0 . "insert") (8 . "XREF - ELECTRICAL - 1")))) (setq ent (ssname en 0)) (setq EN (entget ent)) (setq layno (vl-string-left-trim "XREF - ELECTRICAL - " (cdr(assoc 8 EN)))) (setq dwgpath (getvar "dwgprefix")) (setq dwgname (getvar "dwgname")) (setq nametrim (vl-string-right-trim "HVAC LAYOUT.dwg" dwgname)) (if (= layno "1") (setq layname "1st") ) (if (= layno "2") (setq layname "2nd") ) (if (= layno "3") (setq layname "3rd") ) (if (= layno "4") (setq layname "4th") ) (if (= layno "5") (setq layname "5th") ) (setq newfilepath (strcat nametrim layname " Floor Electrical" )) (setq blkname (vl-string-left-trim dwgpath newfilepath)) (command "-xref" "bind" newfilepath ) ;---------------------------------------------------------------------- (command "script" "blocktoxref.scr" ) )- 1 reply
-
- script command lisp
- lisp
-
(and 1 more)
Tagged with:
-
Select all TEXT objects at the same Y coordinate to enclose them in a rectangle
edmanoligut posted a topic in AutoLISP, Visual LISP & DCL
Hi, dear experts. I'm creating multiple drawings and they all have a bunch of TEXT entities at the same Y coordinate, it could be 1 or it could be more. In order to enclose all of those TEXT entities in each drawing, I normally do this: right click in every drawing quick selection select "text" "Position Y" and then I type "2006" in the "equals to" textbox And then I use the express tool TCIRCLE to enclose them in a rectangle with a variable width. I would like to do this with single lines or commands in the command bar, because the drawings are being made through script commands I programmed in MS Excel, I hope you understand what I mean. Is that possible? or, just like I read online, can only be done through LISP.