Hi Joe,
I haven't had any extra time to spend on this yet.
My original thought was maybe there was something
you could add to a macro (my block, for the most
part, is inserted via a pull down menu) that would
force an anonymous definition to be inserted instead
of the effective named block. Quick "fix".
Lets see if I can explain this without boring everyone 🙂
I've got a dynamic weldsymbol block where the weld
types are controlled via dynamic grips, the remaining
nested components visible states are controlled via code,
as in (vla-put-visible < nested object >).
In an effort to not effect other anonymous blocks of
the same name, every time a nested objects' visibility
is modified a new anonymous block is created in place
of the old one.
The way my code is currently structured, if some blocks
are already anonymous and a new effectively named block
is inserted I get some unwanted modifications to these
new inserts upon executing my code (poor coding and/or
short sightedness on my part).
I think I can fix this code by cloning the dynamic block
reference (as Tony demonstrated) when the nested
objects' visibility is modified. I just need to sit down and
spend a little time with it to ensure no other side effects.
--
Autodesk Discussion Group Facilitator
"Joe Burke" wrote in message
news:5477907@discussion.autodesk.com...
Hi Jason,
Just curious, did you find a way to do it?
I see an empty anonymous block can be added to the blocks collection like
this.
(setq anonblk (vlax-invoke *blocks* 'Add '(0.0 0.0 0.0) "*U"))
My thought there was maybe you could CopyObjects from the dynamic block
definition to
the new anonymous block. I'm sure you could, but I don't see a way to copy
the
dynamic block properties.
And an anonymous block can be inserted like this.
(vlax-invoke *mspace* 'InsertBlock '(0.0 0.0 0.0) "*U8" 1.0 1.0 1.0 0.0)
But if "*U8" is a modified dynamic block, the new block reference is not
dynamic.
Joe