iProp to browser tree

iProp to browser tree

GosponZ
Collaborator Collaborator
766 Views
7 Replies
Message 1 of 8

iProp to browser tree

GosponZ
Collaborator
Collaborator

I'm using this rule for long time, and now need to add custom property to this rule. Could you guys help me? 

 

Thanks

'This rule will make in browser part number, description,

oDoc = ThisDoc.Document

oSheets = oDoc.Sheets

    For Each oSheet In oSheets

        oSheet.activate

        oView = oSheet.DrawingViews.Item(1)

        modelName = oView.ReferencedDocumentDescriptor.ReferencedDocument

        oProp = modelName.PropertySets.Item("Design Tracking Properties")

        ActiveSheet.Sheet.Name = oProp.Item("Part Number").Value & " " & oProp.Item("Description").Value& " " & oProp.Item("Authority").Value

        

    Next

oSheets(1).activate

 

iLogicVb.UpdateWhenDone = True

 

 

0 Likes
Accepted solutions (4)
767 Views
7 Replies
Replies (7)
Message 2 of 8

JhoelForshav
Mentor
Mentor
Accepted solution

@GosponZ 

Are you looking for something like this?

 

oDoc = ThisDoc.Document

oSheets = oDoc.Sheets

    For Each oSheet In oSheets

        oSheet.activate

        oView = oSheet.DrawingViews.Item(1)

        modelName = oView.ReferencedDocumentDescriptor.ReferencedDocument

        oProp = modelName.PropertySets.Item("Design Tracking Properties")
		ocProp = modelName.PropertySets.Item("Inventor User Defined Properties") 'Custom property set

        ActiveSheet.Sheet.Name = oProp.Item("Part Number").Value & " " & oProp.Item("Description").Value & " " & oProp.Item("Authority").Value _
		& " " & ocProp.Item("NAME GOES HERE").Value


    Next

oSheets(1).activate

 

iLogicVb.UpdateWhenDone = True
Message 3 of 8

Martin-Winkler-Consulting
Advisor
Advisor
Accepted solution

There are 4 Property Sets in Inventor. 

Inventor Summary Information/{F29F85E0-4FF9-1068-AB91-08002B27B3D9}

Design Tracking Properties/{32853F0F-3444-11D1-9E93-0060B03C1CA6}

Inventor User Defined Properties/{D5CDD505-2E9C-101B-9397-08002B2CF9AE}

Inventor Document Summary Information/{D5CDD502-2E9C-101B-9397-08002B2CF9AE}

 

You can call the Property Sets with Name or the Guid for example the User Defined Properties:

.PropertySets.Item("Inventor User Defined Properties")

or

.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")

 

If you need more information have a look to this blog post:

https://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html

Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

Message 4 of 8

GosponZ
Collaborator
Collaborator
Accepted solution

Thank you it is working

0 Likes
Message 5 of 8

GosponZ
Collaborator
Collaborator

Thank you

0 Likes
Message 6 of 8

GosponZ
Collaborator
Collaborator

As i said it is working no problem at all. When i place assembly on sheet code doesn't work.

Is it there way to skip assembly. Problem is they want save dxf file as material, part description, and total qty from assembly for that part. With only parts no problem. Would  you guys try to help.

 

Thanks

0 Likes
Message 7 of 8

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @GosponZ 

Try this to skip the property based naming if the view's referenced document is not a part document 🙂

 

oDoc = ThisDoc.Document

oSheets = oDoc.Sheets

For Each oSheet In oSheets

	oSheet.activate

	oView = oSheet.DrawingViews.Item(1)

	modelName = oView.ReferencedDocumentDescriptor.ReferencedDocument

	If modelName.DocumentType = DocumentTypeEnum.kPartDocumentObject 'Only set property based name for part views.

		oProp = modelName.PropertySets.Item("Design Tracking Properties")
		ocProp = modelName.PropertySets.Item("Inventor User Defined Properties") 'Custom property set

		ActiveSheet.Sheet.Name = oProp.Item("Part Number").Value & " " & oProp.Item("Description").Value & " " & oProp.Item("Authority").Value _
		& " " & ocProp.Item("NAME GOES HERE").Value

	End If

Next

oSheets(1).activate



iLogicVb.UpdateWhenDone = True
0 Likes
Message 8 of 8

GosponZ
Collaborator
Collaborator

Thank you works good

0 Likes