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: 

Get the name of ilogic rule

0 REPLIES 0
Reply
Message 1 of 1
theo.bot
470 Views, 0 Replies

Get the name of ilogic rule

Hi there,

 

I want to get the rulename from a rule so i can set it to a string.

 

i found this, but for some reason it doesn't work:

 

- <member name="P:Autodesk.iLogic.Interfaces.iLogicRule.Name">
  <summary>Get or set the name of the rule.</summary>
  </member>
 
I can loop tru all the rules of my document, but i cann't figure out why the single rule name is not working. I must miss something.
 
this is a part of a external rule where that i use to add a rule based on a text file, it checks if the rulename that i fill in exists in the current rule list of that file:
 
Format:HTML Format
Version:1.0
StartHTML: 165
EndHTML: 8499
StartFragment: 314
EndFragment: 8467
StartSelection: 314
EndSelection: 314

'aanroepen Ilogicautomation
auto=iLogicVb.Automation

'declareren van rule en rules als object, rules is een lijst van alle aanwezige rules in het document
DimruleAsObject
DimrulesAsObject
rules=auto.rules(oDoc)

'teller klaarzetten
i=0

'Doorloop de aanwezige rules en controleer of er al een rule met gelijke benaming bestaat
If(NotrulesIsNothing)Then

'Doorloop de aanwezige rules en controleer of er al een rule met gelijke benaming bestaat
ForEachruleInrules
Ifrule.Name=RulenameThen
MessageBox.Show("Een rule met de naam: "&rule.Name&" bestaat al", "Title")
i=i+1
EndIf
Next
'voeg de rule toe, indien de naam nog niet bestond
Ifi=0Then
auto.AddRule(oDoc, Rulename,FileContents)
EndIf
 
can somebody give me a hint??
 
thanks
0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report