Force Update for Skeletal Models

Force Update for Skeletal Models

Anonymous
Not applicable
479 Views
6 Replies
Message 1 of 7

Force Update for Skeletal Models

Anonymous
Not applicable
Has anyone written something to force model updates?

I am refering to

http://discussion.autodesk.com/adskcsp/thread.jspa?threadID=667090

I have about 40 parts in an assy that are created from a common part in which I derive the Skeletal Sketch. All going good until I just changed the Sketch and about 3 parts did not up date...? I had to force the update by going into the parts (that did not update) and edit the derived part... What about parts that don't (obviously) update, until the thing is made and doesn't go together...?

Anyone know of an easy check for this?
0 Likes
480 Views
6 Replies
Replies (6)
Message 2 of 7

psaarloos
Collaborator
Collaborator
Do you also use a link to excel in one or more files? Did you try the rebuild method on all of the documents in your assembly? This could be done really easy by using the AllReferencedDocuments method of the AssemblyDocument object.

Dim RefDoc as Inventor.Document
For Each RefDoc In oAssemblyDoc.AllReferencedDocuments
RefDoc.Rebuild
Next

Maybe you need to rebuild your skeleton and subskeletons first before you rebuild the rest of the documents.

Hope this helps... In the past (a longggg way back)I had problems with updating documents with links to excel, I don't know if these problems still exist.

Kind regards,
Pim Saarloos
Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 3 of 7

Anonymous
Not applicable
Pim, Yes this is linked to excel.
I have no experience in programming. Does this need to be done in VBA?

"Dim RefDoc as Inventor.Document
For Each RefDoc In oAssemblyDoc.AllReferencedDocuments
RefDoc.Rebuild
Next"
0 Likes
Message 4 of 7

psaarloos
Collaborator
Collaborator
Are only the skeleton models linked to excel or also the 'normal' parts? (How many parts are linked to excel?)

You probably get the best results if you only link your skeletons to an excel file and push all the necesary parameters through the skeletons to the 'normal' parts in which you derive the skeletons.

What happens if you rebuild your model (Tools --> Rebuild) without using VBA. Is the model fully updated after the rebuild?

Do you use any VBA code yet?

Kind regards,
Pim Saarloos
Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 5 of 7

Anonymous
Not applicable
"link your skeletons to an excel file and push all the necesary parameters through the skeletons" Yes I am doing this.

"What happens if you rebuild your model (Tools --> Rebuild) without using VBA. Is the model fully updated after the rebuild?" I have not tried this, but will next time I make a change.

"Do you use any VBA code yet?" No
0 Likes
Message 6 of 7

psaarloos
Collaborator
Collaborator
Okee... If the rebuild works that would be the easiest way....

Good luck..!

Kind regards,
Pim Saarloos
Regards,
Pim Saarloos
Product Manager
If my post answers your question, please click the "Accept as Solution" button. Kudos are much appreciated!
0 Likes
Message 7 of 7

Anonymous
Not applicable
sumayo,

I have a VBA solution that might work. It goes through all the components and reads all parameters. This causes the parameters to update if they are linked.

Here's the VBA code. You can create a new VBA project and module and paste this code in.

Sub CheckParameters()
Dim doc As Inventor.Document
For Each doc In ThisApplication.Documents
Dim params As Inventor.Parameters
Set params = GetParameters(doc)
If (Not params Is Nothing) Then
Dim totVal As Double
totVal = 0#
Dim param As Inventor.Parameter
For Each param In params
totVal = totVal + param.Value
Next
End If
Next
End Sub

Function GetParameters(doc As Document)
Set GetParameters = Nothing
If (doc.DocumentType = kPartDocumentObject) Then
Dim partDoc As PartDocument
Set partDoc = doc
Set GetParameters = partDoc.ComponentDefinition.Parameters
Else
Dim assemDoc As AssemblyDocument
Set assemDoc = doc
Set GetParameters = assemDoc.ComponentDefinition.Parameters
End If
End Function
0 Likes