PDA

View Full Version : Controlling Dynamic Blocks via code


psu15635
2006-06-24, 09:46 AM
Problem statement:
We used to put in a section cut as an exploded block, rotate the cut direction and stretch the tail to the correct length (pretty crude huh). This was bad, but it was easy enough to write the code to draw the correct block dynamically with three picks. Think about it. The first pick is where the 'bubble' is, the second is the length and direction of the tail and a third point tells you which way to point the cut. That's all you need, the rest is simple code to draw it dynamically just like their stupid menu function.

Now we have gone to dynamic blocks. I'll give you that they are easier to manipulate, but they still go in one way then you fix them. That is about a one in eight chance you pointed the right way and you still fix the tail length. If you see the problem as constanty fixing section cuts that go the wrong way, good solution, but is that really the the right problem your solving? I still see the problem as put it in right and the easiest way.

SO . . . what I need to learn is how to get at the variables of the dynamic block so I can reset the direction, stretch point, ect. I'm thinking . . get the insert entity, walk thru the blocks entity list of dotted pairs and change what I need to.

I've never seen the 'codes' for the dotted pairs documented. Anybody know the codes for the dotted pairs for a dynamic block or know whether this is possible approach in Autolisp? Do I need to use the ARX API to do this? and please don't tell me that the VB approach is the way to go. I hate anything that smells like Redmond.

gb

CAB2k
2006-06-24, 05:00 PM
I haven't worked with dynamic blocks but it shouldn't be that hard, should it?? :)

This is all that I found in my brief search, http://tinyurl.com/evz3f