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
Solved! Go to Solution.
Solved by ebachrach. Go to Solution.
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
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
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
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
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
‘***************************
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
Can't find what you're looking for? Ask the community or share your knowledge.