Subassembly Composer: Testing NESTED IF () AND () expression for variable code to shapecode ouput

Subassembly Composer: Testing NESTED IF () AND () expression for variable code to shapecode ouput

tom_cools63N7X
Contributor Contributor
448 Views
3 Replies
Message 1 of 4

Subassembly Composer: Testing NESTED IF () AND () expression for variable code to shapecode ouput

tom_cools63N7X
Contributor
Contributor

Hello Everybody, 

 

I want also make a .pkt file/subassembly based on decisions.

To be more detailed, i want to put a code in the shape witch is based on different factors that will be determined in Civil3d by inputparameters. So one combination off that factors needs to give one unique code.

 

But the use of the "IF" and "AND" in de expression editor doesnt work in my pkt file...anyone knows why this is giving an error? The error message says (translated from dutch) "Cannot derive a general type because multiple types are possible"

 

tom_cools63N7X_0-1710423534828.png

 

I attached the pkt file also

 

Many tnx already if you are watching this and would give a solution for this problem!!

 

Grtz Tom Cools

0 Likes
Accepted solutions (1)
449 Views
3 Replies
Replies (3)
Message 2 of 4

ecfernandez
Mentor
Mentor
Accepted solution

Hi @tom_cools63N7X, the error is there because you are placing zeros "0" at the end. That makes the program identify many different variable types possible. You defined your variable as "string," so if you wanted to keep your "0," you should use Ctype to change the number to string. 

I removed the zeros and then your condition worked. Take a look

 

ecfernandez_0-1710424770533.png

I hope this helps. Best regards!

 

Camilo Fernández

Civil engineer | Specialist in design, construction, and maintenance of roadways

EESignature

LinkedIn
0 Likes
Message 3 of 4

tom_cools63N7X
Contributor
Contributor

Wow tnx @ecfernandez for the VERY fast respons and giving me the good solution!! Grtz 🙂

Message 4 of 4

ecfernandez
Mentor
Mentor

Hi @tom_cools63N7X, I am happy to help. Best regards 😀 

Camilo Fernández

Civil engineer | Specialist in design, construction, and maintenance of roadways

EESignature

LinkedIn
0 Likes