Rule that add text to idw when specific materials and color is used

Rule that add text to idw when specific materials and color is used

maarten_desmet
Participant Participant
395 Views
2 Replies
Message 1 of 3

Rule that add text to idw when specific materials and color is used

maarten_desmet
Participant
Participant

Hi,

 

I'm searching for a rule that add's text to the .idw if the Title block contains *Material "S235 JR" and has **Color "Brut".

 

*Material

This is already 'taken' from the part's propertie thats in the drawing.

 

**Color

This is chosen by the user in the Form.

 

If the combination of these two is correct the text "FREE FROM OXYDE" should appear on the titleblock on a specific location.

 

maartendesmet_0-1713964366832.png


Anyone that can help?

Thanks!

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

Michael.Navara
Advisor
Advisor

How to display:

The easiest way is to create custom iProperty in drawing document and in the TitleBlock definition create TextBox with reference to this iProperty. You can easily specify text format and position. By default the iProperty value is empty

 

I don't know what does it mean "chosen by the user in the Form". You need to store this value somewhere. For example in iProperty or parameter.

 

In this case you can create simple macro where you compare two values and if they are equal, you set the iProperty value

Dim part As PartDocument = ThisDrawing.ModelDocument
Dim materialMatch As Boolean = part.ActiveMaterial.Name = "S235 JR"
Dim colorMatch As Boolean = CheckIfColorMatch() ' Pseudocode. Must be implemented

If materialMatch And colorMatch Then
    iProperties.Value("Custom", "TitleBlockNote") = "FREE FROM OXYDE"
Else
    iProperties.Value("Custom", "TitleBlockNote") = ""
End If

 

 

0 Likes
Message 3 of 3

maarten_desmet
Participant
Participant

Hi, thanks a lot! 

 

What I mean is that the color is chosen within a form and not coming from the part itself.
It's a custom iPropertie linked to a paramter list in the .idw template.

 

So what I need is that the rule checks what the text is inside the iPropertie 'color'. 

0 Likes