Inventor General Discussion

Reply
Contributor
YoniGaia
Posts: 18
Registered: ‎06-14-2011
Message 1 of 7 (1,265 Views)
Accepted Solution

Automatic Update of Model Revision Number

1265 Views, 6 Replies
06-14-2011 12:27 PM

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

Product Support
bobvdd
Posts: 535
Registered: ‎11-23-2005
Message 2 of 7 (1,249 Views)

Re: Automatic Update of Model Revision Number

06-14-2011 04:17 PM in reply to: YoniGaia

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

Contributor
YoniGaia
Posts: 18
Registered: ‎06-14-2011
Message 3 of 7 (1,236 Views)

Re: Automatic Update of Model Revision Number

06-15-2011 12:08 AM in reply to: bobvdd

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

Product Support
bobvdd
Posts: 535
Registered: ‎11-23-2005
Message 4 of 7 (1,226 Views)

Re: Automatic Update of Model Revision Number

06-15-2011 09:50 AM in reply to: YoniGaia

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

Employee
MjDeck
Posts: 958
Registered: ‎02-24-2009
Message 5 of 7 (1,209 Views)

Re: Automatic Update of Model Revision Number

06-15-2011 01:15 PM in reply to: bobvdd

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
DLS - Mechanical Design
Autodesk, Inc.

Contributor
YoniGaia
Posts: 18
Registered: ‎06-14-2011
Message 6 of 7 (1,198 Views)

Re: Automatic Update of Model Revision Number

06-15-2011 10:24 PM in reply to: YoniGaia

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

Active Member
marcoo
Posts: 9
Registered: ‎04-26-2010
Message 7 of 7 (1,021 Views)

Re: Automatic Update of Model Revision Number

07-05-2012 06:43 AM in reply to: YoniGaia

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.


---
Autodesk Inventor 2012 Professional x64 SP2
Win 7 x64, Intel i7 930, 6GB PC-1600, Quadro FX-1800, 250 Gb 10k RMP

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube