Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic Get Driven Dimension in Form

Anonymous

iLogic Get Driven Dimension in Form

Anonymous
Not applicable

Hello.

 

I am working in an assembly and in that assembly I have a part that has a driven dimension. I want to get that value from that part, to my form in my assembly.

 

The rule in the part is working, but I can´t link it to my assembly.

 

This is what I am trying:

 

Part

DrivenStaander = DrivenLengthStaander

This gives the result of my Driven Dimension into an User Parameter, which is what I want.

Now I want that parameter to link to my parameter in my assembly so I can use it, something like this.

 

Assembly

If DrivenStaander > 1500 Then

        Staander = DrivenStaander/1500
    
    Parameter("Trapladder Leuning:1", "DrivenStaander") = DrivenStaander
    Parameter("Trapladder Frame 01:1", "Staander") = Staander
End If

 Outcome gives nothing to work with.

 

 

 

Any ideas?

 

Mark

0 Likes
Reply
Accepted solutions (1)
1,362 Views
13 Replies
Replies (13)

Amit_11
Contributor
Contributor

Try this:

 

 

If Parameter ("Part" "DrivenStaander") > 1500 Then 
Staander = Parameter ("Part" "DrivenStaander")/1500
Parameter("Trapladder Leuning:1", "DrivenStaander") = Parameter ("Part" "DrivenStaander")
Parameter("Trapladder Frame 01:1", "Staander") = Staander
End If

 ' I don't know the name of your part so I just use "Part". If the part is embedded in some sub assembly, then use Parameter(MakePath("SubAssem1:1", "Part"), "DrivenStaander") instead of Parameter ("Part" "DrivenStaander")

0 Likes

Anonymous
Not applicable

What's up Mark?

 

So I'm not too sure what this portion of your code is trying to do as far as applying the parameter goes, but if you're getting a dimension from a part to an assembly, it's as easy as 1, 2,

 

AssemblyParameter = Parameter("PartName","ParameterName")

 

Then use it for whatever you'd like to. 🙂

 

Is there a purpose I'm not understanding? Or is that it?

0 Likes

Anonymous
Not applicable

Morning Will,

 

Basically I want a driven dimension going from a part to an assembly.
Using the standard Parameter-Part-to-Parameter-Assembly works for my normal dimension, but it doesn't work for my driven dimension.

AssemblyParameter = Parameter("PartName","ParameterName(this is a driven dimension)")

Doesn't give a result.

 

AssemblyParameter = Parameter("PartName","ParameterName(this is a normal dimension)")

Does give the dimension as a result.

 

I need the driven dimension to calculate.

Any ideas?

 

Regards,
Mark

0 Likes

RodrigoEiras
Advocate
Advocate

 

Hi Mark,

 

I have done the test and for me it works without problems when you try to get from the assembly a parameter, even if it is a driven dimension.

 

Could you post a screenshot of the part parameters tab in both cases, when it is a driven or not driven dimension?

 

Best regards

 

 

 

Rodrigo

 

0 Likes

Anonymous
Not applicable

Morning,

 

You may try to update the document 'before' the rule pulls the parameter? This would be...

 

InventorVb.DocumentUpdate()

 

AssemblyParameter = blahblahblah

 

That may be worth a shot.

 

Does your AssemblyParameter just not change at all? Is there perhaps another way to get the same result without using the reference parameter?

0 Likes

Anonymous
Not applicable

Will,

 

Didn't do anything unfortunately.
It does change in the part file, it just doesn't change in my assembly.

 

I just noticed that it's a reference parameter, is this treated different?

 

This is a screenshot of the part parameters.

 

2015_05_26_15_51_12_Start.png

 

Regards,

Mark

0 Likes

Anonymous
Not applicable
Note on the above that I don't want to CHANGE the parameter. I just want to USE it for calculations. The number itself doesn't/can't change, since it's a reference.
0 Likes

Amit_11
Contributor
Contributor
Can't see your screenshot!!
0 Likes

RodrigoEiras
Advocate
Advocate

I believe the problem is with the syntax

 

If you want to run the rule from the assembly it looks the syntax should be:

 

 

If Parameter("Trapladder Leuning:1", "DrivenStaander")> 1500 Then

     Parameter("Trapladder Frame 01:1", "Staander")= Parameter("Trapladder Leuning:1", "DrivenStaander")/1500

     Component.InventorComponent("Trapladder Frame 01:1").Definition.Document.Update()

End If

 

I understand you want to read the parameter "DrivenStaander" from part "Trapladder Leuning:1", and if it is bigger than 1500 then make the parameter "Staander" from part "Trapladder Frame 01:1" equal to DrivenStaander/1500. Is that right?

 

 

 

 

0 Likes

Anonymous
Not applicable
Rodrigo,

That's not correct, DrivenStaander is an User Parameter from the assembly.

This is what I am trying:

If DrivenStaander > 1500 Then
Staander = Parameter("Trapladder Frame 01:1", "Staander")
DrivenStaander = Parameter("Trapladder Leuning:1", "DrivenLength")
End If

I need Staander to be equal to the Frame Parameter and DrivenStaander equal to the Part Parameter. That is my main concern.

The Staander is working properly, because in my eyes it's a normal dimension given. The DrivenStaander is the one that has the driven dimension, which is not working.

Greets,
Mark
0 Likes

RodrigoEiras
Advocate
Advocate

 

I saw that your part is Adaptative. Can that be creating some kind of "circular reference" with that parameter?. In that case you may have to remove the adaptativity to the part.

 

Without the files I am afraid I cannot help you much further.

 

Good luck!

 

 

0 Likes

Anonymous
Not applicable
Accepted solution

Okay,

 

So this worked...

 

    Staander = Parameter("Trapladder Frame 01:1", "Staander")
    DrivenStaander = Parameter("Trapladder Leuning:1", "DrivenLength")

If DrivenStaander > 1500 Then
    Staander = DrivenStaander / 1500
End If 

 

I don't understand why it didn't do this before, because I tried a similair thing before.

 

Greetings,
Mark

0 Likes

Anonymous
Not applicable

@Gogan1337 wrote:
I just found out why it wouldn't work. The IF statement didn't work with it. So I guess you can't use the Driven Dimension for an IF statement? That seems weird to me, but now it does go through....

Mark

Yeah I'm not sure.

 

I was going to try to find a second to recreate the issue and troubleshoot it but this thread developed faster than I could get to it.

 

Glad you got it to work I suppose.

0 Likes