Change the way partnummer is show on drawing

Change the way partnummer is show on drawing

Darkforce_the_ilogic_guy
Advisor Advisor
303 Views
4 Replies
Message 1 of 5

Change the way partnummer is show on drawing

Darkforce_the_ilogic_guy
Advisor
Advisor

We have an nummer system(partnummer) that looks somthing like this  2234653000000.  But we want it to be show somthing like this in the Title blok 2 234 65 3000000. Is there a easy way to do this in the Title blok  ? If possible I do not want to change anything on the 3d files

0 Likes
304 Views
4 Replies
Replies (4)
Message 2 of 5

Ralf_Krieg
Advisor
Advisor

Hello

 

Afaik there's no way to format the string in titleblock direct. But you can create a custom Property with formatted string. You have to make sure, the Property stays in sync with the partnumber property. Also there's some precheck needed to make sure partnumber is filled and a number.

iProperties.Value("Custom", "customPN") = CLng(iProperties.Value("Project", "Part Number")).ToString("0 000 00 0000000")

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 5

Darkforce_the_ilogic_guy
Advisor
Advisor

ok So there is no way to make a text box and code it to only take the first nummer like left(<Part nummer>, 1) <space> mid(<Part nummer>, 2,3) <Space> mid(<Part nummer>, 5,2)<Space>  right(<Part nummer>, 6) or something like that ?

 

 

0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

Hi @Darkforce_the_ilogic_guy.  If it was just simple, static text within the TextBox, then you could most likely do that spacing thing without much trouble.  But most of the time the FormattedText behind TitleBlock TextBoxes contain XML tags and complex data link information for creating a live link to a property, not just a simple property value.  Although there are a few ways to format some information within FormattedText, the main formatting capabilities are things like Font, FontSize, Bold, Italic, & Underline. (Link1)  One alternative to creating a custom iProperty might be to point the iProperty link within the TextBox to the DrawingDocument, instead of the Model document, then once the value from the model is copied to the drawing to populate the drawing's iProperty, you could modify the value of the drawing's iProperty to suit your needs.  This will be using the standard properties, and leave the model property alone, as requested, but still allow a modified drawing version for use in the drawing's title block.  You would just need a fairly simple iLogic rule to use on the drawing side (could be an external rule), and the rule could be set to run on an event trigger, to modify the drawing's iProperty, if needed.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 5

Ralf_Krieg
Advisor
Advisor

Hello

 

No, you can not do that in the titleblock. You could add a simple textbox somewhere on the sheet and add the modified string there. To identify the textbox later, e.g. to check and update the partnumber, add an attribute to the textbox.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes