iProperties - Custom

iProperties - Custom

Wayne.peacockSF88J
Participant Participant
306 Views
2 Replies
Message 1 of 3

iProperties - Custom

Wayne.peacockSF88J
Participant
Participant

When creating an IDW drawing of a sheet metal item, it is possible to place text with the Text tool &

In the  Format Text box, change the type of text pull down menu to "Sheet Metal Properties" and in the Parameter pull down menu change it to "FLAT PATTERN EXTENTS LENGTH" then click the "X" inset button, which gives you

<FLAT PATTERN EXTENTS LENGTH>

When you click on OK, the text gives you the length of the the sheet metal part.

 

My question is, how can I create a custom iProperty that will achieve the same result and also format the value to the precision that i require?

0 Likes
307 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor

Hi @Wayne.peacockSF88J . If you need to create a custom property in your SheetMetalDocument , then try this code. In order to change the number of values after the decimal point, change this - FormatNumber(SheetMetal.FlatExtentsLength, 3) & " mm".

Dim sLENGTH As String = FormatNumber(SheetMetal.FlatExtentsLength, 3) & " mm"
iProperties.Value("Custom", "FLAT PATTERN EXTENTS LENGTH") = sLENGTH

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

WCrihfield
Mentor
Mentor

Hi @Wayne.peacockSF88J.  If you simply create a custom iProperty in your sheet metal part that contains the needed size, that value will be 'static' not 'live' or 'linked'.  But you could attempt to keep it updated by causing the rule to get triggered to run whenever the model changes in size.  But if you really want to achieve 'the same exact functionality' as what you described by what you manually did in the Format Text dialog box, you will need to work with the note's FormattedText, which includes some XML tags, and that can get somewhat complicated to do.  Below are a couple of simple little iLogic rule tools that you can use to 'inspect' an already existing LeaderNote or GeneralNote within a drawing, to see what it has within its 'FormattedText', when it contains some 'linked' data.  These will help you learn what you need to do to simulate most of the same exact functionality that you can achieve with the Format Text dialog.

This rule is for inspecting a LeaderNote:

Dim oLNote As LeaderNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingNoteFilter, "Select a leader note to inspect.")
If oLNote Is Nothing Then Return
Dim oEditedFText As String = InputBox("Here is the LeaderNote.FormattedText:", "LeaderNote.FormattedText", oLNote.FormattedText)
'then use the next line if you want to change it to how you edited it above
'oLNote.FormattedText = oEditedFText

...and this nearly identical rule is for inspecting a GeneralNote:

Dim oGNote As GeneralNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingNoteFilter, "Select a drawing general note to inspect.")
If oGNote Is Nothing Then Return
Dim oEditedFText As String = InputBox("Here is the GeneralNote.FormattedText:", "GeneralNote.FormattedText", oGNote.FormattedText)
'then use the next line if you want to change it to how you edited it above
'oGNote.FormattedText = oEditedFText

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)