Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Dynamic Block Visibility State

32 REPLIES 32
Reply
Message 1 of 33
mid-awe
969 Views, 32 Replies

Get Dynamic Block Visibility State

Hi all,

I have found some information for working through lisp with dynamic blocks, but I need to call a function with the dynamic block's name and return the visibility state. ex. (getdyblkvisstat "dyblknam").
Does anyone have something like this or should I try to modify some of the routines floating around?

Thanks.
32 REPLIES 32
Message 21 of 33
Anonymous
in reply to: mid-awe

Must have more coffee before posting...

--
Autodesk Discussion Group Facilitator


"Jason Piercey" wrote in message
news:5805784@discussion.autodesk.com...

> what it going happening.
Message 22 of 33
Ian_Bryant
in reply to: mid-awe

Hi Jason,
the function checks through the ACAD_ENHANCEDBLOCK
extension dictionary of the main block definition
for the BLOCKVISIBILITYPARAMETER entity.
The Label is in the 301 dxf code of this entity.
I use DBview.arx to figure out what is stored
in which dictionary.
You can download it from:
http://autodesk.blogs.com/between_the_lines/2006/07/dbview_for_auto.html

Regards Ian
Message 23 of 33
Anonymous
in reply to: mid-awe

I've got the dbview.arx and use it often for the same
purpose as you. Very handy tool. I was dumping
objects before and didn't see anything helpful,
hadn't had enough time to dig through DXF codes.

I'll probably look at revising your function to work
for any parameter. Would make a nice addition to
the toolbox.


--
Autodesk Discussion Group Facilitator


wrote in message news:5806403@discussion.autodesk.com...
Hi Jason,
the function checks through the ACAD_ENHANCEDBLOCK
extension dictionary of the main block definition
for the BLOCKVISIBILITYPARAMETER entity.
The Label is in the 301 dxf code of this entity.
I use DBview.arx to figure out what is stored
in which dictionary.
You can download it from:
http://autodesk.blogs.com/between_the_lines/2006/07/dbview_for_auto.html

Regards Ian
Message 24 of 33
mid-awe
in reply to: mid-awe

I'd like to use a lisp function to manipulate a dynamic border and title block. That is what started my question. Each border and title block custom to the border will have identical attributes. I want all the attributes to change and contain the same information. I store the information in the dictionary. I have an OpenDCL frontend for working with the dynamic title block but I need to change the visibility states. So, I need a lisp method.

I do of course know: the dyn-block name, the name of the visibility state and all other information specifically about the block other than the current value of the visibility state. I want to tell it a current value and have it change.

Am I going about this wrongly? Would it be better to make lisp draw my border and title block, in order to edit the information that way? I need to be able to edit the attributes of the title block. I want it dynamic so that I can eliminate inserts. I only need four versions of the title block and I assumed that I could handle them as individual visibility states. Will I be able to edit the attributes of all 4 title blocks no matter the visibility state of the dynamic block?

Thanks again.
Message 25 of 33
Anonymous
in reply to: mid-awe

wrote in message news:5807661@discussion.autodesk.com...

> I do of course know: the dyn-block name, the name of the visibility
> state and all other information specifically about the block other than
> the current value of the visibility state. I want to tell it a current
> value
> and have it change.

Using some of the code posted in this thread, you should be able
to get the name of the current visibility state.


> Will I be able to edit the attributes of all 4 title blocks no matter
> the visibility state of the dynamic block?

I don't see why you wouldn't be able to modify all of the attributes.


--
Autodesk Discussion Group Facilitator
Message 26 of 33
mid-awe
in reply to: mid-awe

Jeff,

Every time I try your code I get "; error: bad argument type: VLA-OBJECT nil". I know I'm using the correct block name, but what can I be doing wrong?

Thanks
Message 27 of 33
Anonymous
in reply to: mid-awe

IIUC,
Sounds like you could use fields for this.

Create the normal title block tags, for the primary/usual visibility state.
Then do the following (as I recall):
For the tags for the other visibility states, *use the attdef command* - you
can't do the field thing from the properties palette 😞 - and create your
new tags (matchprop the original tags as needed) - then for the value area,
choose the field->object->tag->value option, selecting the appropriate tag
you need to copy. Be sure to check the box marked 'use values from block
insert'.

Try it with one tag to make sure you have things set up properly.
Put the 'tag copies' in their appropriate visibility states.

When you are done, you should only need to enter the data once upon block
insertion (manually or via a lisp routine). When the other visibility
options are selected, and you do a regen, the attributes should fill in
based on the original data.

Note that the user can still change the attribute of the other visibility
tags independently (if they're not too bright), not sure how to prevent
this.

I don't know that you'd need a dictionary for this, but if it helps, hey.

Best regards,
David Kozina


wrote in message news:5807661@discussion.autodesk.com...
I'd like to use a lisp function to manipulate a dynamic border and title
block. That is what started my question. Each border and title block custom
to the border will have identical attributes. I want all the attributes to
change and contain the same information. I store the information in the
dictionary. I have an OpenDCL frontend for working with the dynamic title
block but I need to change the visibility states. So, I need a lisp method.

I do of course know: the dyn-block name, the name of the visibility state
and all other information specifically about the block other than the
current value of the visibility state. I want to tell it a current value and
have it change.

Am I going about this wrongly? Would it be better to make lisp draw my
border and title block, in order to edit the information that way? I need to
be able to edit the attributes of the title block. I want it dynamic so that
I can eliminate inserts. I only need four versions of the title block and I
assumed that I could handle them as individual visibility states. Will I be
able to edit the attributes of all 4 title blocks no matter the visibility
state of the dynamic block?

Thanks again.
Message 28 of 33
mid-awe
in reply to: mid-awe

Hey thanks, I'll try that.
Message 29 of 33
Anonymous
in reply to: mid-awe

What could be wrong? Probably me cut/pasting code from some different things
I had tried and not checking to be sure all of the varaibles are the
same......egads, it's not often I post code that I haven't explicitly run,
but this is one of those....sorry about that.

And Jason's right, this assumes the Visibility parameter is named
"Visibility"...mainly because I didn't know it could be anything
else.....time to learn more about these DB's.

Anyway, this line:
(setq props (vlax-invoke tmp 'GetDynamicBlockProperties))

should be:
(setq props (vlax-invoke ent 'GetDynamicBlockProperties))



"MiD-AwE" wrote in message news:5808042@discussion.autodesk.com...
Jeff,

Every time I try your code I get "; error: bad argument type: VLA-OBJECT
nil". I know I'm using the correct block name, but what can I be doing
wrong?

Thanks
Message 30 of 33
mid-awe
in reply to: mid-awe

Thanks Jeff,

Works great now.
Message 31 of 33
Anonymous
in reply to: mid-awe

Something else your post reminded me of, that I thought I would mention...
About that dictionary you are using to store information...

Have you looked into using the SummaryInfo property of the Document object
for storing drawing information?

One nice thing about that proprerty is that you can see the information in
Windows Explorer...
(Data dictionaries are a bit more opaque, as you might imagine.)

Depends on your needs, of course.

Best regards,
David Kozina


wrote in message news:5807661@discussion.autodesk.com...
I'd like to use a lisp function to manipulate a dynamic border and title
block. That is what started my question. Each border and title block custom
to the border will have identical attributes. I want all the attributes to
change and contain the same information. I store the information in the
dictionary.

Message 32 of 33
mid-awe
in reply to: mid-awe

Yes, you are right. I currently mirror specific project, customer, & sales representative information to the SummaryInfo for the reason of quick searching and archiving.

Thanks again.
Message 33 of 33
mid-awe
in reply to: mid-awe

David Kozina,

I did as you said and the "field" attributes appear in all visibility states even after I set them for only the vis state I want them to appear in. I have another idea that I'll try. Do you have any suggestions?

Thanks again.

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

Post to forums  

Autodesk Design & Make Report

”Boost