Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Mentor
mid-awe
Posts: 1,198
Registered: ‎12-08-2004
Message 1 of 20 (617 Views)
Accepted Solution

Invisible Attribute Constant Dynamic Block Visibility State?

617 Views, 19 Replies
01-24-2013 07:07 AM

Hi all,

 

I have a dynamic block with several visibility states, and each visibility state has one invisible-constant attribute. I can't seem to wrap my head around dynamic blocks well enough to get the value from the active visibility state invisible constant attribute. I know how to get the visibility state like this:

(setq ss (ssget "_x" (list '(0 . "INSERT") '(2 . "`*U*,<DynBlockName>") (cons 410 (getvar 'ctab)))))

 but what next?

 

Thank you.

Mentor
mid-awe
Posts: 1,198
Registered: ‎12-08-2004
Message 2 of 20 (593 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-25-2013 06:55 AM in reply to: mid-awe

Seeing that there has been no suggestions I'm wondering if I'm going about this the wrong way. Is there a better way to get information about the drawing in the visibility state of the dynamic block?

 

I am inserting a dynamic block with several plants each in a seperate visibility state. I need the botanical name of the visible plant. I have placed that information in the invisible attribute but if there is a better way where I can get that information when I need it, then I am open to any suggestion.

 

Thank you.

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 3 of 20 (590 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-25-2013 07:00 AM in reply to: mid-awe

mid-awe wrote:

Seeing that there has been no suggestions I'm wondering if I'm going about this the wrong way. Is there a better way to get information about the drawing in the visibility state of the dynamic block?

 

I am inserting a dynamic block with several plants each in a seperate visibility state. I need the botanical name of the visible plant. I have placed that information in the invisible attribute but if there is a better way where I can get that information when I need it, then I am open to any suggestion.

 

Thank you.


Interesting , I'll have a look-see tomrrw mid-awe

 

Hang in there.

 

:smileyhappy:

Mentor
mid-awe
Posts: 1,198
Registered: ‎12-08-2004
Message 4 of 20 (577 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-25-2013 09:23 AM in reply to: pbejse

Thank you pbejse, I'm standing still. Completely stumped after I dxf dumped the dblock and found no clues, but alas, I haven't worked with dynamic blocks much in the past. I'm eager to hear what you find. Thank you again. :smileyhappy:

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 5 of 20 (564 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-25-2013 10:58 PM in reply to: mid-awe

mid-awe wrote:

Thank you pbejse, I'm standing still. Completely stumped after I dxf dumped the dblock and found no clues, but alas, I haven't worked with dynamic blocks much in the past. I'm eager to hear what you find. Thank you again. :smileyhappy:


mid-awe,

 

It can be done with invisible attributes. but i need a sample of your DB to write a custom made code to work on your blocks.

 

Or you can use dictionary , like the ones you had before.

 

Your choice

 

:smileyhappy:

 

Mentor
mid-awe
Posts: 1,198
Registered: ‎12-08-2004
Message 6 of 20 (551 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-27-2013 07:03 AM in reply to: pbejse

That sounds encouraging :smileyhappy:

I've attached a sample of my DB

 

Thank you very much.

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 7 of 20 (539 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-27-2013 08:07 PM in reply to: mid-awe

mid-awe wrote:

That sounds encouraging :smileyhappy:

I've attached a sample of my DB

 

Thank you very much.


That is not a Dynamic block, anyhoo, The thread title says Invisible Constant, hence the value is always the same for depending on the  Visibility state.

 

Block name FruitBasket

Visibilty state: Mango

Constant/Invisible Attribute value :Ripe

 

Visibilty state: Banana

Constant/Invisible Attribute value :Green

......

 

is that how you want it?

 

 

Mentor
mid-awe
Posts: 1,198
Registered: ‎12-08-2004
Message 8 of 20 (536 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-27-2013 08:20 PM in reply to: pbejse

pbejse wrote:

That is not a Dynamic block

 


Oh, I don't have a recent version of ACAD here on the weekends. I just sent a backup copy of the block I assumed it was correct. :smileyembarrassed:
Yeah, you seem to have the idea of what I going for.
*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 9 of 20 (527 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-27-2013 09:42 PM in reply to: mid-awe

mid-awe wrote:

pbejse wrote:

That is not a Dynamic block

 


Oh, I don't have a recent version of ACAD here on the weekends. I just sent a backup copy of the block I assumed it was correct. :smileyembarrassed:
Yeah, you seem to have the idea of what I going for.

In that case you dont need to create an invisible/contstant attribute for every Visibility states, one is enough and it has all the data for every Visibiltiy name

 

Attribute string:

"(\"BANANA\" \"LONG\") (\"MANGO\" \"RIPE\") (\"EGG\" \"HARD BOILED\")"

 

(setq data
(read (strcat "(" (vla-get-textstring (extracted attribute) ")"))
)

 

Now depending on the visibility name: 

ex. current block visibility : MANGO

 

(assoc "MANGO" data)

("MANGO" "RIPE");<-- RIPE being the data 

 

simple eh?

 

HTH

 

Mentor
mid-awe
Posts: 1,198
Registered: ‎12-08-2004
Message 10 of 20 (512 Views)

Re: Invisible Attribute Constant Dynamic Block Visibility State?

01-28-2013 06:52 AM in reply to: pbejse

That does seem simple, but it could take several days to change all of the dynamic blocks to that format. To be honest I'm  strapped for time now and if it's possible to get the value of the invisible/contstant attribute for each Visibility state it would help out a lot. Also, I only need the value from the active visibility state. 

 

I will use this in conjunction with my block counting code so that as the blocks are counted the values of the visibility state along with the botanical names can be stored into the dictionary to build the legend.

 

I'm back at my desk this morning so I'm attaching the correct version of the block I attached earlier. (just in the case that it may help.)

 

Thank you again this is a big help. :smileyhappy:

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community