Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Automatic Update of Model Revision Number

Anonymous

Automatic Update of Model Revision Number

Anonymous
Not applicable

When we insert a Revision Table to a drawing we have the option to update Revision Number property in the drawing. This property is updated whenever we add a Revision Row.

I want Inventor to update the Revision Number property in the model the same way.

If this is not possible, is there a way to automatically map the Revision Number property in the drawing to the Revision Number property in the model?

 

Please advise,

Yoni

0 Likes
Reply
Accepted solutions (2)
4,380 Views
9 Replies
Replies (9)

bobvdd
Alumni
Alumni

What if the drawing revision does not involve a geometry change in the part,  do you still want to bump the revision in the part? Looks like a strange workflow to me but if you want to proceed with it, here is some iLogic code you can place in the drawing that changes the revision of the component found in the first view on the first sheet. Trigger the rule "Before save".

 

Dim odrawdoc As DrawingDocument
odrawdoc = ThisApplication.ActiveDocument
Dim odoc As Document
Try
odoc = ThisApplication.Documents.Open(odrawdoc.Sheets.Item(1).DrawingViews.Item(1).ReferencedDocumentDescriptor.FullDocumentName, False)
odoc.PropertySets.Item("Summary Information").Item("Revision Number").Value = odrawdoc.PropertySets.Item("Summary Information").Item("Revision Number").Value
Catch
End Try

 
Cheers

Bob




Bob Van der Donck


Principal UX designer DMG group

Anonymous
Not applicable

Hi Bob,

 

Thanks for the quick response.

When I added a rule in IV2011 iLogic Your code generated the following error:

" Error on Line 5 : Comma, ')', or a valid expression continuation expected. "

 

Unfortunately, I do not possess the knowledge to debug it.

Please help.

 

Regards,

Yoni

0 Likes

bobvdd
Alumni
Alumni

Are you sure you copied and pasted  the exact same code correctly? Especially this line:

 

odoc = ThisApplication.Documents.Open(odrawdoc.Sheets.Item(1).DrawingViews.Item(1).ReferencedDocumentDescriptor.FullDocumentName, False)

 

 

It looks to me that one of the closing round brackets ")" might be missing in your copied text.

Can you check if you have "...False)" and not "...False" without bracket or something similar.

Bob




Bob Van der Donck


Principal UX designer DMG group
0 Likes

MjDeck
Autodesk
Autodesk
Accepted solution

Bob,

 

 There seems to be a problem with pasting code directly from the iLogic rule editor to this forum.  I recommend pasting to Notepad first, and then copying and pasting from Notepad to this forum.

 Here's a simplified version of your rule.  This will work in Inventor 2011 and later:

Dim odrawdoc As DrawingDocument
odrawdoc = ThisDrawing.Document
Dim odoc As Document
Try
odoc = ThisDrawing.ModelDocument
odoc.PropertySets.Item("Summary Information").Item("Revision Number").Value = odrawdoc.PropertySets.Item("Summary Information").Item("Revision Number").Value
Catch
End Try

 


Mike Deck
Software Developer
Autodesk, Inc.

Anonymous
Not applicable
Accepted solution

Mike / Bob,

 

Thank you.

The last code works perfectly (I transfered it through notepad just in case...)

 

This kind of straight forward right-to-the-point online support is something I can easyly get used to...

 

Regards,

Yoni

0 Likes

Anonymous
Not applicable

that's exactly what I was trying to develop!! the reason is quite simple:

the quickest way to up the revision for a component drawing is by adding a new revision line in the revision table, but when you have a BOM in assembly drawing it takes component MODEL revision, not DRAWING.. are there any other better solutions to the one in here?

 

code is neat and work great with 2011, thank you.

0 Likes

Anonymous
Not applicable

So glad I finally found this thread. Been searching for this rule code for a while now. Works perfectly and is saved in my rules folder.

 

Thank you!!!!

0 Likes

bobvdd
Alumni
Alumni
I am glad too that you liked the code 😀
Bob



Bob Van der Donck


Principal UX designer DMG group

alex.vernooij
Explorer
Explorer

 Hi all

 

I used you code, and it works perfectly for parts (.ipt), thanks! But I cannot make it work for assemblies... does anybody know how to make it work? I am not familiar with Ilogic.

 

Thanks in advance!

 

Nerea

0 Likes