Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use external DLL methods in ETO Rules

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
gadurai
1327 Views, 10 Replies

How to use external DLL methods in ETO Rules

HI,

 

I am trying to create Assembly through ETO rules.

I have added child rule to this root (assembly) for child parts, Mate constraints and drawing creation. It’s all works fine.

One of my parts is having patterned holes and the no. of patterned holes parameter is passed from the Parameter rule available in the root while creating child instance.

My part consists of ‘n’ of Holes.
I need to get the Total no. of patterned holes and its features name. So I am using external DLL to get the No. of patterned holes and its participant features (Axis) name for centre mark creation in drawing view.

I am calling my method available in the external  dll through ETO method inside Root design.

It is giving me the correct result at first time. But whenever I am changing the Parameter value of my design , subsequently the method has not updating from the external dll. It is showing me the older value.

 

My Code snippets are as below:

‘***************************

 

Parameter Rule WAxis As  List

           

       WAxis = GetHoleAxes()

           

End Rule

Method GetHoleAxes() As List

Return ETOGetInfo.HoleDetails.GetHoleAxes(Autodesk.Intent.IntentAPI.Instance.HostAPI.TopLevelAssembly)

End Method

‘***************************

 

If I am executing the “GetHoleAxes” method in the immediate window, it is giving me the correct result.

 

Regards,

Appadurai.G

 

10 REPLIES 10
Message 2 of 11
FarrenYoung
in reply to: gadurai

The problem is your rule WAxis is getting bound and never knows to be unbound. You can make the rule Uncached or you could add something inside the rule to force it to unbind when other rules are unbound. You have proven that your method works by executing it at the immediate window and getting the right result.
--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 3 of 11
gadurai
in reply to: FarrenYoung

Hi Farren,

 

Thank you for your reply.

Since I am new to ETO, Can you guide me to handle Unbounding any rule parameter with simple sample.

 

thanks in Advance.

 

Regards,

Appadurai.G

 

Message 4 of 11
FarrenYoung
in reply to: gadurai

There are a few ways.
To manually unbind the rule you can find it in the properties tab of the intent model browser pane and right-click->Unbind.
You could also use the unbindslot() function.
The automatic way to have the rule unbind would be to add any rule/s that unbind to this rule.
For example,
Parameter Rule WAxis As List
Me.%%updateself 'this rule should become unbound if anything it references changes. when %%updateself unbinds the WAxis rule will also unbind since it refernces %%updateself
WAxis = GetHoleAxes()
End Rule

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 5 of 11
ebachrach
in reply to: gadurai

Depending on how often you call this rule, the simplest approach would be to add the uncached flag to the rule. This would force the rule to evaluate every time it was referenced.  The formula of an uncached rule is evaluated whenever the rule is referenced.  Your rule would read as follows:

 

Uncached Parameter Rule WAxis As  List

           

       WAxis = GetHoleAxes()

           

End Rule

 

Elly


--
Autodesk
Elly Bachrach
ETO/CTO Solutions Designer
Intelligent Configuration Solutions
Mobile +1 (773) 401-6980
elly.bachrach@gmail.com

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 6 of 11
gadurai
in reply to: ebachrach

Hi Elly,

 

 

Thanks for your reply.

Even after i have Uncached the Rule, I am not getting the Updated parameter value.

 

I am calling this rule whenever updating the Root Parameters.

 

I am using this parameter in the child desing(Drawing) to get the no. of Active holes available in the Model to generate the Centermark.

 

Regarda,

Appadurai.G

Message 7 of 11
ebachrach
in reply to: gadurai

Sorry, let me clarify and suggest something a little different.

 

Being uncached doesn't mean that the rules depending on it automatically reevaluate. it just means that this rule will always give the current value.  The drawing entities that rely on your waxis rule don't know that they need to be unbound. So I think this lack of dependency on something actively being changed in the eto rules is the issue.

 

One way you would do this is by making your children, which depend on waxis, depend also on whatever user modified parameters are driving the pattern change.  In this case, by waxis being uncached, it will return the correct value.

 

But you can also add a reference to the actual parameter that is modified to your Waxis rule.  When the user (or whatever external process you use) modifies the parameter that is driving the changes, your Waxis rule is unbound and needs to be reevaluated (this would occur even if you don't mark it as uncached).  This is a more specific  version of Farren's forced referencing of the %%updateself rule.

 

The Code snippet would look like this

‘***************************

 Parameter Rule NumHolesInputParameter as integer = 5 ' this is the rule a user is modifying somehow

Parameter Rule WAxis As  List

        dim dummyref as any = numholesinputparameter

       WAxis = GetHoleAxes()

           

End Rule

Method GetHoleAxes() As List

Return ETOGetInfo.HoleDetails.GetHoleAxes(Autodesk.Intent.IntentAPI.Instance.HostAPI.TopLevelAssembly)

End Method

‘***************************

 

 


--
Autodesk
Elly Bachrach
ETO/CTO Solutions Designer
Intelligent Configuration Solutions
Mobile +1 (773) 401-6980
elly.bachrach@gmail.com

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 8 of 11
gadurai
in reply to: gadurai

Thanks Elly.

 

Now I have understood the Cocept behind Calling External DLL and Rules.

 

Its working fine now.

 

Once again thanking you for your support.

 

Regards,

Appadurai.G

Message 9 of 11
Srinath5089
in reply to: gadurai

can i know intent code to keep numbering for holes for attachment shown below

Message 10 of 11
Srinath5089
in reply to: Srinath5089

how can i number the  holes by using intent code  in below drawing view

 

 

 

 

 

Message 11 of 11
JackGregory
in reply to: Srinath5089

Please start a new thread for a new question.

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

Post to forums  

Autodesk Design & Make Report