Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assembly Simulation : Update View at will and not by default ?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
323 Views, 4 Replies

Assembly Simulation : Update View at will and not by default ?

Anonymous
Not applicable
Hi,

How can we update the positions(Transformation Matrix) of more than one component or occurrence(say 20 components) at the same time ?

The following is the code, but it results in update of ActiveView for each component for each frame. Ideally I would want the update of ActiveView once a frame.


for(int iFrame = 0; iFrame < noOfFrames; iFrame++)

{  AllOccurrencesInNthFrameArray = (Array)AllFramesTransformArray.GetValue(iFrame);

  for(int iOccurrence = 0; iOccurrence < noOfOccurrences; iOccurrence++)

  {

   temp_occurrenceTransformArray = (Array)AllOccurrencesInNthFrameArray.GetValue(iOccurrence);

   //Get Current Occurrence

   current_occurrence = (Inventor.ComponentOccurrence)m_occurencesArray.GetValue(iOccurrence);


   current_occurrenceTransformation.PutMatrixData(ref temp_occurrenceTransformArray);

   current_occurrence.Transformation = current_occurrenceTransformation;

  }

  m_inventorApplication.ActiveView.Update();

}



But in Inventor 2008, the update of component's position is happening in the for-loop itself, which is not intended.



Is there any way to stop auto-update of assembly components, so that ActiveView.Update() can be used whenever needed.



Regards,

Rajeev Lochan

Blog: http://www.smallguru.com

Web: http://www.ar-cad.com


Edited by: lochan94 on Oct 23, 2008 1:12 AM Edited by: lochan94 on Oct 23, 2008 1:14 AM
0 Likes

Assembly Simulation : Update View at will and not by default ?

Hi,

How can we update the positions(Transformation Matrix) of more than one component or occurrence(say 20 components) at the same time ?

The following is the code, but it results in update of ActiveView for each component for each frame. Ideally I would want the update of ActiveView once a frame.


for(int iFrame = 0; iFrame < noOfFrames; iFrame++)

{  AllOccurrencesInNthFrameArray = (Array)AllFramesTransformArray.GetValue(iFrame);

  for(int iOccurrence = 0; iOccurrence < noOfOccurrences; iOccurrence++)

  {

   temp_occurrenceTransformArray = (Array)AllOccurrencesInNthFrameArray.GetValue(iOccurrence);

   //Get Current Occurrence

   current_occurrence = (Inventor.ComponentOccurrence)m_occurencesArray.GetValue(iOccurrence);


   current_occurrenceTransformation.PutMatrixData(ref temp_occurrenceTransformArray);

   current_occurrence.Transformation = current_occurrenceTransformation;

  }

  m_inventorApplication.ActiveView.Update();

}



But in Inventor 2008, the update of component's position is happening in the for-loop itself, which is not intended.



Is there any way to stop auto-update of assembly components, so that ActiveView.Update() can be used whenever needed.



Regards,

Rajeev Lochan

Blog: http://www.smallguru.com

Web: http://www.ar-cad.com


Edited by: lochan94 on Oct 23, 2008 1:12 AM Edited by: lochan94 on Oct 23, 2008 1:14 AM
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

 

A new method
AssemblyComponentDefinition.TransformOccurrences was added in
Inventor 2009 to address this. Unfortunately, there isn't a great solution for
Inventor 2008. You could try setting the 'Defer Updates' option for assemblies,
but I don't think that's buy you much.

 

Sanjay-
0 Likes


 

A new method
AssemblyComponentDefinition.TransformOccurrences was added in
Inventor 2009 to address this. Unfortunately, there isn't a great solution for
Inventor 2008. You could try setting the 'Defer Updates' option for assemblies,
but I don't think that's buy you much.

 

Sanjay-
Message 3 of 5
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
Thanks Sanjay for responding,

It is sad to know that there is no direct way to do this in Inventor 2008. By setting



m_inventorApplication.AssemblyOptions.DeferUpdate = true;



As far as I understand and have checked, it is used when we dont want Part/Occurrences/Components files to be updated when we make any changes to them in an assembly. I guess the changes here mean those made to Sketches/part features of the individual parts and not the "TransformationMatrix" of these parts.



Please help me out if my understanding is wrong.



Thanks,

Rajeev Lochan

http://www.smallguru.com
0 Likes

Thanks Sanjay for responding,

It is sad to know that there is no direct way to do this in Inventor 2008. By setting



m_inventorApplication.AssemblyOptions.DeferUpdate = true;



As far as I understand and have checked, it is used when we dont want Part/Occurrences/Components files to be updated when we make any changes to them in an assembly. I guess the changes here mean those made to Sketches/part features of the individual parts and not the "TransformationMatrix" of these parts.



Please help me out if my understanding is wrong.



Thanks,

Rajeev Lochan

http://www.smallguru.com
Message 4 of 5
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

Yes, you're right about the intent of the defer
updates flag. However, there have been instances of performance improving
(slightly) when that flag is set (even when the referenced components haven't
changed). In any case, I don't think it'll help you. Sorry, there isn't a better
solution for Inventor 2008.

 

Sanjay-  
0 Likes


Yes, you're right about the intent of the defer
updates flag. However, there have been instances of performance improving
(slightly) when that flag is set (even when the referenced components haven't
changed). In any case, I don't think it'll help you. Sorry, there isn't a better
solution for Inventor 2008.

 

Sanjay-  
Message 5 of 5
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
Thanks again for the help
0 Likes

Thanks again for the help

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

Post to forums  

Autodesk Design & Make Report