Drawing label for custom design tracking Iproperty

Drawing label for custom design tracking Iproperty

josh.linares-stanley
Enthusiast Enthusiast
325 Views
1 Reply
Message 1 of 2

Drawing label for custom design tracking Iproperty

josh.linares-stanley
Enthusiast
Enthusiast

Hi,

I have the following ilogic script that formats flat pattern views. It does work, However i'd prefer for the "Thickness" to be custom design tracking property like the other iproperties that are in 'grey'. oGauge seems to just quote the current value instead of tie the text to the true value of the model.

joshlinaresstanley_1-1643371783424.png

 

doc = ThisDoc.Document
For Each oSheet In doc.Sheets
  For Each oView In oSheet.DrawingViews
    If oView.IsFlatPatternView Then
		
        'capture the current view label
                ViewLabel = oView.name
			'clear current view label	
				oView.Label.FormattedText = ""
				
                oModelName = _
                oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
                Try
					oMaterial = "<StyleOverride Underline='False'><Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
           			oGauge = iProperties.Value(oModelName, "Custom", "Thickness")
					oDescription = "<StyleOverride Underline='false'> - <Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
					oPartNumber = "<StyleOverride Underline='false'><Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>"
					oStringScale = "<Br/><StyleOverride FontSize='0.25'>(SCALE <DrawingViewScale/>)</StyleOverride>"
					
							            'add the the iProperty to the current view label, with a dash separator
                oView.Label.FormattedText = oPartNumber & oDescription & "<Br/>CONSTRUCTED FROM " & oGauge & " THK " & oMaterial & oStringScale & "<Br/>FLAT PATTERN"
            Catch
            'do nothing if error
                End Try
    End If
  Next
Next

 

 

 

 

 

0 Likes
Accepted solutions (1)
326 Views
1 Reply
Reply (1)
Message 2 of 2

JelteDeJong
Mentor
Mentor
Accepted solution

As far as I know, there is no property for the thickness that you can use. But you could change the line:

oGauge = iProperties.Value(oModelName, "Custom", "Thickness")

to:

oGauge = Parameter(oModelName, "Thickness")

The parameter "Thickness" is always up to date. (The iProperty Thickness is not updated automatically by default) Then if the rule works you could add it to the event trigger "Before save document". then you know when you save the drawing the view labels get updated.

JelteDeJong_0-1643378982291.png

 

Jelte de Jong
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


Blog: hjalte.nl - github.com