Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
Reply
Message 1 of 3
maarten_desmet
149 Views, 2 Replies

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

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!

Labels (4)
2 REPLIES 2
Message 2 of 3

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

 

 

Message 3 of 3

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'. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report