Jump to content

copy multiline attribute data to command line


Recommended Posts

Posted
This is the block i wanna use..............

 

JM

 

Really ?????? :shock:

 

You have two accounts now !!! :lol:

 

That's not allowed :nono:

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    9

  • pmxcad

    8

  • Lee Mac

    7

  • pBe

    3

Top Posters In This Topic

Posted

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

Posted

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.

Posted (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 by pBe
wrong syntax
Posted

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\" \"\" )"

Posted

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

Posted

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

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...