same iProperties ipt and idw

same iProperties ipt and idw

binsar_z
Enthusiast Enthusiast
1,643 Views
4 Replies
Message 1 of 5

same iProperties ipt and idw

binsar_z
Enthusiast
Enthusiast

severall days ago, i got an answer how to copied iProperties from model to .idw trough iLogic (Thanks Rob Cohee).

but, if we want to fill or change iProperties from both .ipt/.iam and .idw, and update both of them, is iLogic can help?

 

Thanks

0 Likes
1,644 Views
4 Replies
Replies (4)
Message 2 of 5

Mike.Wohletz
Collaborator
Collaborator

is this property going to be changed in the drawing and you want it pushed back to the part or assembly that is in the base view?  If so then you could iterate the drawing views and when you have the base view grab that item and set the property you are looking for the same as the drawing. If you are trying to go from part/assembly up then I guess I would not know how you would find the drawing..

This should set the "Part Number" the same in the base view items as it is in the drawing..

 

 

   Dim oDoc As Document = ThisApplication.ActiveDocument
	  Dim DTP As PropertySet = oDoc.PropertySets.Item("Design Tracking Properties")
	  Dim PN as String = DTP.Item("Part Number").Value
	  
        For Each oView As DrawingView In ActiveSheet.Sheet.DrawingViews
            If oView.ParentView Is Nothing Then
                Dim oRefDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
                Dim oDTP As PropertySet = oRefDoc.PropertySets.Item("Design Tracking Properties")
                If Not oDTP.Item("Part Number").Value = PN Then
				oDTP.Item("Part Number").Value = PN
				End If
            End If
        Next

 

 

0 Likes
Message 3 of 5

binsar_z
Enthusiast
Enthusiast

Thank you for helping, Mike.

 

your iLogic rule working when change part number from idw and it reflected in ipt file.

Actually we need iProperties interchangeable from ipt and or idw file. So we able change it - no different- from ipt or idw, and iProperties will reflected each other. in our standard drawing, we only put one ipt or one iam file in our idw file.

In your iLogic sample, only provide to change part number, would you please give another rule if we want all fields in iProperties in ipt/iam and idw reflected each other?, also if we have custom iProperties.

 

0 Likes
Message 4 of 5

Mike.Wohletz
Collaborator
Collaborator

How will the part or iam know what drawing it is? Going from drawing down is easy since the part or iam is a reference member of some view.

 

also an ILogic rule to do this is going to start a cycle with every time one changes it changes the other etc.

 

0 Likes
Message 5 of 5

binsar_z
Enthusiast
Enthusiast

Hi Mike,

 

Thank you for your respons.

its some code we put in our idw template:

 

'Exit rule If no Part or Assembly Is in the drawing yet

If (ThisDrawing.ModelDocument Is Nothing) Then Return

'get the file name of the doc the drawing points to

modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)

'read the values from the iProperties in the part file
'then apply to the iProperties with the same name in the drawing file

iProperties.Value("Project", "Description") = iProperties.Value(modelName,"Project", "Description")
iProperties.Value("Project", "Revision Number") = iProperties.Value(modelName,"Project", "Revision Number")
iProperties.Value("Project", "Project") = iProperties.Value(modelName,"Project", "Project")
iProperties.Value("Status", "Checked By") = iProperties.Value(modelName,"Status", "Checked By")
iProperties.Value("Status", "Eng. Approved By") = iProperties.Value(modelName,"Status", "Eng. Approved By")
iProperties.Value("Status", "Eng. Approved Date") = iProperties.Value(modelName,"Status", "Eng. Approved Date")
iProperties.Value("Status", "Status") = iProperties.Value(modelName,"Status", "Status")

 but, it only working if we made some change in ipt or iam, and iProperties will copied to idw exactly as in ipt or iam.

now, how if we need ability change iProperties from idw or ipt and will update it each other?

 

0 Likes