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: 

Possible to extract part revision and place in IDW revision?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
kwilson_design
1260 Views, 7 Replies

Possible to extract part revision and place in IDW revision?

Good morning,

 

I am trying to create some new templates for 2013 and I'm trying to figure a way to get the model revision number to populate into the drawing's iproperty revision number so that they will match upon save. I'm trying to do this by creating an ilogic rule but I don't see a system property in the idw that will allow me to access the 3D model iprops. I am going to Event Trigger the rule to run Before Save. Is this possible?

 

On the drawing border I have created a formatted text box that is built as:

Type: Properties - Model

Property: Revision Number

 

It simply pulls the data from the models revision number and populates the text box. I need this same thing to happen but rather than populate into a text box I need it to populate into the drawings revision number iprop. 

 

Regards,
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!
7 REPLIES 7
Message 2 of 8

Not entirely sure if this is what you want but it works for me.

 

Capture.JPG

 

 

Capture2.JPG

Brendan Henderson
CAD Manager


New Blog | Old Blog | Google+ | Twitter


Inventor 2016 PDSU Build 236, Release 2016.2.2, Vault Professional 2016 Update 1, Win 7 64 bit


Please use "Accept as Solution" & give "Kudos" if this response helped you.

Message 3 of 8

Thanks for the post but no I'm wanting the models revisions number to populate into the drawings iproperty revision number. We did this with some VB code in the past but we are no longer going to use extermal VB on ilogic.

Regards,
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!
Message 4 of 8

Hi kwilsonamerex,

You might try this.

Go to the Tools tab > Options panel > Document Settings button, and then click the Drawing tab in the dialog box.

Look for the Copy Model iProperty button toward the bottom.

 

This opens the Copy Model iProperty Settings dialog box where you can select model iProperties to copy into the drawing iProperties.

 

Do this in your drawing template and then save your template, and this setting will be setup for all new files. But for existing files you'll need a bit of code. I'll post back if I have a chance to create a quick rule.


I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


Message 5 of 8

Hi kwilsonamerex,

 

This rule reads the model document's rev# and writes it to the drawing's rev#.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


 

'Look at the model file referenced in the open document
Dim MDocFile As Document
If ThisDoc.ModelDocument IsNot Nothing then
MDocFile = ThisDoc.ModelDocument
Else
MessageBox.Show("This drawing has no model reference", "iLogic")
Return
End if

'format model file name                   
Dim FNamePos As Long
FNamePos = InStrRev(MDocFile.FullFileName, "\", -1)                
Dim docFName As String 
docFName = Right(MDocFile.FullFileName, Len(MDocFile.FullFileName) - FNamePos) 

'set the drawing rev number to match the model rev number
iProperties.Value("Project", "Revision Number") = iProperties.Value(docFName, "Project", "Revision Number")
'update the drawing
iLogicVb.UpdateWhenDone = True

 

Message 6 of 8

Thanks Curtis for chiming in!

 

Dang that's a nice little Copy Model Props feature. Buried though but thanks for pointing it out to me. I like using it however it seems it only populates the iproperty once time. If I go back and make a new revisions or title change on the model, it won't update that info back into the drawings iprops. Wierd....

 

But that's ok as we use Vault and will push down the next Vault revision via "Update Properties" in CAD once lifecycle has changed from Released to WIP.

 

So this will get me what I need and create a little less redundant manual entry from users. Thanks again Curtis! You The Man! 🙂

Regards,
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!
Message 7 of 8


@kwilson_design wrote:

Thanks Curtis for chiming in!

 

... however it seems it only populates the iproperty once time. If I go back and make a new revisions or title change on the model, it won't update that info back into the drawings iprops. Wierd....




Hi kwilsonamerex,

 

I'm happy that was useful.

 

As for the updating issue, if you go to the Manage tab you'll find an Update Copied Properties button that will help with this.

 

More on this from the help files:

 

Copy model properties to a drawing

Drawing Document Settings provide a mechanism for copying values of selected model iProperties to the drawing iProperties on first view creation. The copied properties can be used in parts lists, title blocks, and other functions that access model or drawing properties.

  1. Open the drawing and select Tools tab > Options panel > Document Settings.
  2. On the Drawing tab of the Document Settings dialog box, click Copy Model iProperty Settings.
  3. In the Copy Model iProperty Settings dialog box, select Copy Model iProperties, and then select iProperties to copy to the drawing.
  4. Click OK to close the Copy Model iProperty Settings dialog box.
  5. Click Apply and OK to save the document settings and close the Document Settings dialog box.
TipUse the Additional Custom Model iProperty Source option in drawing Document Settings to make custom iProperties from an external file available in the drawing.

Update model iProperties in a drawing

Model iProperties copied to a drawing are not refreshed automatically when the model is updated. Use the Update Copied Model iProperties command to refresh the iProperties.

  1. With a drawing open, select Manage tab > Update panel > Update Copied Properties.
  2. Click Yes to confirm the update on a message box. The copied model properties are updated in the drawing.

Notes:

  • All existing drawing overrides for iProperties copied from the model are discarded on the update.
  • Model iProperties are copied and updated in the drawing from a source model. The source model is always the top model from the first drawing view on the first drawing sheet.
  • The Update Copied Model iProperties command is not available, if the drawing is in a deferred mode or if the source model is not available.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 8 of 8

Thanks for the useful info Curtis! I kept looking for the little lightning Update icon up top and never saw it. Dind't think to go into the Manage tab and walla, there it is! Thanks again!

Regards,
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!

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

Post to forums  

Autodesk Design & Make Report