Tharwat Posted September 23, 2011 Posted September 23, 2011 This is the block i wanna use.............. JM Really ?????? You have two accounts now !!! That's not allowed Quote
pmxcad Posted September 23, 2011 Author Posted September 23, 2011 Sorry Tharwat. Is the account from a new colleague at work. And we want to bring the thread running again between you and Lee. We want this lisp very much. JM Quote
Cad64 Posted September 23, 2011 Posted September 23, 2011 Please stick to just one account per thread. If your colleague started the thread then use that account all the way through. Once you start tag-teaming on the thread it just confuses everyone and it makes it look like you have multiple accounts. But if you feel you must continue where your colleague left off, in order to keep the thread moving, be sure to state that in your post so we know what's going on. Quote
pmxcad Posted September 23, 2011 Author Posted September 23, 2011 Ok. it wil not happens again. Quote
pBe Posted September 25, 2011 Posted September 25, 2011 (edited) I would use "TEXT" rather than "MTEXT" because of its formating The default string value would be something like: "(command \"_Layer\" \"_S\" \"0\" \"ON\" \"BIS_CCTV\" \"OFF\" \"BIS_BRAND,BIS_INBRAAK,BIS_TGC,HYPERLINK,BIS_ATT\" \"\" )" (defun c:test ( / attb cmd2run) (setvar 'cmdecho 0) (setq attb (ssget ":S:E" '((0 . "INSERT") (66 . 1)))) (cond ((and attb (setq cmd2run (car (vl-remove-if-not '(lambda (j) (eq (vla-get-tagstring j) "SCR") ) (vlax-invoke (vlax-ename->vla-object (ssname attb 0)) 'GetAttributes ) ) ) ) ) (setq cmd2run (read (vla-get-textstring cmd2run))) (eval (read cmd2run)) ) ) ) Try it Edited September 27, 2011 by pBe wrong syntax Quote
pmxcad Posted September 25, 2011 Author Posted September 25, 2011 yeah, yes yes. Works perfect. Thanks pBe. pBe, can you explain the \"\ and \"_S\ In the txt file ? Is this a sort of one line script and stands \"\ for ENTER? "(command \"_Layer\" \"_S\" \"0\" \"ON\" \"BIS_CCTV\" \"OFF\" \"BIS_BRAND,BIS_INBRAAK,BIS_TGC,HYPERLINK,BIS_ATT\" \"\" )" Quote
pBe Posted September 26, 2011 Posted September 26, 2011 You're welcome pmxcad. gald it works for you. The "_S" stands for SET like the one you had before, -LAYER SET 0 -LAYER ON BIS_CCTV -LAYER OFF BIS_BRAND,BIS_INBRAAK,BIS_TGC,HYPERLINK,BIS_ATT All i did is translate your script to command syntax equivalent, nothing special there my friend. Cheers Quote
pmxcad Posted September 26, 2011 Author Posted September 26, 2011 Ok.......but, what is the ENTER, the backslash/ or the double quote" and the reason for using underscore in front of the _S? Thanks, PmxCAD Quote
pBe Posted September 27, 2011 Posted September 27, 2011 the forward slash and " together represents the symbol " AutoLISP control characters Code Description \" " character _ Automatically translates the command that follows into other languages So the line \"\" represents "" also known as Enter as for the _ on "_S" just force of habit i guess, you can replace it with the word "SET" and it still works. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.