Author Topic: Applying Dynamic actions  (Read 1895 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Applying Dynamic actions
« on: May 11, 2015, 05:07:19 PM »
If you have dynamic block that has parameters and actions applied to an attribute.

Then you do a custom ATTSYNC routine and the AttributeReference is erased and a new AttributeReference is added.

How do you apply the actions or set the parameter values for the new AttributeReference?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Applying Dynamic actions
« Reply #1 on: May 19, 2015, 04:58:55 PM »
I know I'm guilty of not making sense most of the time but did the previous post make sense what I was trying to ask?

For example a dynamic block with a move and rotate action on a attribute then replacing that attribute and applying the move the rotation action to the new attribute.

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Applying Dynamic actions
« Reply #2 on: May 19, 2015, 05:13:54 PM »
Made sense to me. Never had that scenario come up in my work so have never really thought about it. Was hoping to see one the gurus pop in to show us how it might be done.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Applying Dynamic actions
« Reply #3 on: May 19, 2015, 05:15:22 PM »
Thanks Jeff,

Gonna ask at forums to see if ADN team has an idea.


Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Applying Dynamic actions
« Reply #4 on: May 19, 2015, 06:33:56 PM »
Jeff, does this mean the Andrey's AttSync doesn't work like you'd like it to?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Applying Dynamic actions
« Reply #5 on: May 19, 2015, 11:22:45 PM »
Hey Jeff,

I'm familiar with Andrey's ATTSYNC and will look at it again to see if it handles dynamic actions applied to it, but was not using it because this routine was a different approach needed for a job. It basically erases all attributes except a ID, and adds three that are fields for its position, and then ensures no ID's are duplicated in drawing and a excel file. It then finds matching ID in excel file and if the column has a value it adds a attributeReference for it.


They are blocks set up by a client and did not like a bunch of empty attributes or many of the attributes used.
I tried explaining to them when you have attributes CertainComponent1, CertainComponent2, CertainComponent3 ... CertainComponentX and a blockreference might need 1 all the way up to X, is a sign you might be using one block to represent to many things and attributes with option1/option2/option3/option4
is another sign that one block is probably busy, not to mention a bunch of manufacturer specific attributes that only applied to half.

I Added ability to export attributes to a worksheet for each block and letting them fill in what they wanted and leaving a cell empty left attribute off blockreference made them happy.


 

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Applying Dynamic actions
« Reply #6 on: May 20, 2015, 12:00:32 AM »
Ah, got it. Complicated stuff that is more complicated than need be due to client ideas of keeping it 'simple'. ;-)

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Applying Dynamic actions
« Reply #7 on: May 20, 2015, 12:52:49 AM »
As always Norman gave great insight and made me realize just cause its attribute doesn't mean the anonymous definition needs to get out of sync.

AutoCAD might use ATTSYNC and if runs across a dynamic block use  BlockTableRecord.UpdateAnonymousBlocks

Quote from: BlockTableRecord.UpdateAnonymousBlocks
Updates the anonymous blocks created from this dynamic block definition to reflect any changes made to the dynamic block definition.

Calling this method after updating a dynamic block definition causes AutoCAD to replace all anonymous block definitions created from this definition with new anonymous block definitions, thereby causing all references to reflect changes made to the dynamic block. The update preserves the values of dynamic block properties on the references where possible, adding newly created properties and deleting properties that no longer exist. When complete all references to the dynamic block reflect the new state of the block definition.