Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoLISP or Script

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
sukhmeeth
489 Views, 8 Replies

AutoLISP or Script

hi 

 

can anyone here help write a lisp routine that can be run project wide to hide/show attributes . The user must be given an option to select an object , write or select attribute name and also select multiple drawings from the project. 

 

I have a code that updates the attribute value , attaching that - Please help change that to hide/show attributes

8 REPLIES 8
Message 2 of 9
vladop
in reply to: sukhmeeth

Attached file might be helpful.

 

Please read this post:

Re: Script AEHIDEATT - Autodesk Community - AutoCAD Electrical

 

Regards,

Vladimir

 

Message 3 of 9
sukhmeeth
in reply to: vladop

Thanks ! this helped is there something like this for showATT too !
Message 4 of 9
vladop
in reply to: sukhmeeth

Visibility is controlled by the first bit of the group code 70. 

In attached LISP file this group code is stored in xx variable: (setq xx (cdr (assoc 70 ed))).

This is description of all four bits, but I think you are not interested in other three (2, 4 and 8):

  1 = Attribute is invisible (does not appear)
  2 = This is a constant attribute
  4 = Verification is required on input of this attribute
  8 = Attribute is preset (no prompt during insertion)

 

Some examples (bit 1 which controls visibility is marked red):

Group code=9. Binary it is 100

  Attribute is invisible (bit1=1), Not constant (bit2=0), Verification not required (bit3=0), Preset(bit4=1)

 

Group code=12. Binary it is 110

  Attribute is visible (bit1=0), Not constant (bit2=0), Verification is required (bit3=1), Preset(bit4=1)

 

Group code=3. Binary it is 0011

  Attribute is invisible (bit1=1), Constant (bit2=1), Verification not required (bit3=0), Not preset(bit4=0)

 

Group code=1. Binary it is 0001

  Attribute is invisible (bit1=1), Not constant (bit2=0), Verification not required (bit3=0), Not preset(bit4=0)

 

If (= (logand xx 1) 0) expression IS TRUE than the first bit is eqaul to 0 (that means that attribute is visible).

To make it invisible use (1+ xx) expression. This expression only increments first bit without changing other bits.

 

If you want to make it visible than do the opposite:

If (= (logand xx 1) 0) expression IS NOT TRUE than the first bit is eqaul to 1 (that means that attribute is invisible)

To make it visible use (1- xx) expression. This expression only decrements first bit without changing other bits.

 

Regards,

Vladimir

 

 

 

Message 5 of 9
sukhmeeth
in reply to: vladop

Yes i was able to figure that out and had both the routines working project wide. Thanks for the detailed explanation. The first post was also really helpful .
Message 6 of 9
vladop
in reply to: sukhmeeth

Message 7 of 9
sukhmeeth
in reply to: vladop

Yeah I saw this but I wanted to make a lisp routine that toggles visibility project wide instead of going drawing by drawing because the projects I am working on have more than 200 drawings .
And yes I was able to make both the routines showATT and hideATT successfully that runs project wide.
Message 8 of 9
vladop
in reply to: sukhmeeth

I meant using  vla-put-invisible insted of the group codes.

 

Message 9 of 9
sukhmeeth
in reply to: vladop

I had tried that but that does not work for multiple drawings ! only working for active Document

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report