Sync IPN iproperties with IAM/IPT (stock number, title in example)

Sync IPN iproperties with IAM/IPT (stock number, title in example)

Anonymous
Not applicable
1,051 Views
7 Replies
Message 1 of 8

Sync IPN iproperties with IAM/IPT (stock number, title in example)

Anonymous
Not applicable

Hello,
for the IDW (drawing) iProperties are synced with the part or assembly, but for the IPN (presentation) it isnt.
Is there a way to get the properties synced? 

In my example I need "stock number" and "title" snyced.

Settings? Or a VBA code, because iLogic doesnt work in IPN... 😞

0 Likes
Accepted solutions (1)
1,052 Views
7 Replies
Replies (7)
Message 2 of 8

dgreatice
Collaborator
Collaborator

Hi,

 

try this, in illogic rule:

 

Sub Main
Sub GetPropertyIAM()
Dim oApp As Application
Dim oDD As DrawingDocument
Dim oSht As Sheet
Dim oDV As DrawingView
Dim oRefIPN As PresentationDocument
Dim oRefIAM As AssemblyDocument
Dim oPropSets1 As PropertySet
Dim oPropSets2 As PropertySet

Dim oStockNo As inventor.Property
Dim oTitle As inventor.Property

oApp = ThisApplication
oDD = oApp.ActiveDocument
oSht = oDD.ActiveSheet
oDV = oApp.CommandManager.Pick(16898, "Select View")
oRefIPN = oDV.ReferencedDocumentDescriptor.ReferencedDocument
oRefIAM = oRefIPN.ReferencedDocumentDescriptors.Item(1).ReferencedDocument
oPropSets1 = oRefIAM.PropertySets.Item("Design Tracking Properties")
oPropSets2 = oRefIAM.PropertySets.Item("Inventor Summary Information")
oStockNo = oPropSets1.Item("Stock Number")
oTitle = oPropSets2.Item("Title")

MsgBox (oStockNo.Value)
MsgBox (oTitle.Value)
End Sub
Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 3 of 8

Anonymous
Not applicable
Accepted solution

As I already said, in IPN iLogic isnt available. 😞

But I rewritten the code for the vba.

Public Sub iProperties_IPN()
Dim oDoc As Inventor.Document
Set oDoc = ThisApplication.ActiveDocument 'Get current document
Dim oModel As Inventor.Document
Set oModel = oDoc.ReferencedDocuments.Item(1) 'Get first inserted doc

Dim oPropsetsDoc As PropertySets
Set oPropsetsDoc = oDoc.PropertySets
Dim oPropSetDoc As PropertySet
Set oPropSetDoc = oPropsetsDoc.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")

Dim oStockNumberDoc As Property
Set oStockNumberDoc = oPropSetDoc.Item("Stock Number")

Dim oPropsetsModel As PropertySets
Set oPropsetsModel = oModel.PropertySets
Dim oPropSetModel As PropertySet
Set oPropSetModel = oPropsetsModel.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")

Dim oStockNumberModel As Property
Set oStockNumberModel = oPropSetModel.Item("Stock Number")

oStockNumberDoc.Value = oStockNumberModel.Value

Set oPropSetDoc = oPropsetsDoc.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}")
Set oTitleDoc = oPropSetDoc.Item("Title")
Set oPropSetModel = oPropsetsModel.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}")
Set oTitleModel = oPropSetModel.Item("Title")

oTitleDoc.Value = oTitleModel.Value

'MsgBox (oStockNumberDoc.Value)
'MsgBox (oTitleDoc.Value)

'MsgBox (oStockNumberModel.Value)
'MsgBox (oTitleModel.Value)
End Sub

I think experts can a write it better, but it works.

0 Likes
Message 4 of 8

dgreatice
Collaborator
Collaborator

Lol, did you try my code?

its ilogic Code.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 5 of 8

Anonymous
Not applicable

Yes, I tried!

1. Your code is for use in IDW and I need it for IPN! Without any IDW!
2. In IPN you cant use ilogic. Only VBA macro!

Thx

0 Likes
Message 6 of 8

bradeneuropeArthur
Mentor
Mentor

use Add ins eg: vb.net

this has advantage that VBA doesn't have!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 7 of 8

dgreatice
Collaborator
Collaborator

Ok,

 

I misunderstood, I think you want to get the properties (from IAM used in IPN) synced to IDW.

 

My opinion, its better you direct get the properties from assembly, not to IPN. but it you needed.

for me you will twice to synced, IAM synced to IPN then to IDW.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 8 of 8

Anonymous
Not applicable

I sync from IAM to IPN and from IAM to IDW.
IAM is the main part. That give me the option to change iproperties for IPN and IDW seperated, if I want to and its more save to get the iproperties directly from the IAM, because ie if no IPN is set.

0 Likes