Subassembly Composer - Point Codes

Subassembly Composer - Point Codes

seanp.fahey
Advocate Advocate
4,670 Views
7 Replies
Message 1 of 8

Subassembly Composer - Point Codes

seanp.fahey
Advocate
Advocate

Does anyone know if Subassembly Composer has some coding that allows a user to input a custom point code, but it will add to that custom point code depending on if the subassembly composer is on the right or left side?

I am trying to avoid having a bunch of custom point codes that someone has to fill out and have the subassembly perform most of the work.  

 

For example, I have a curb and gutter subassembly that when I am modeling the feature lines are crossing over the baseline and creating linework that is not correct.  My thinking is that if I had different enough point codes then the feature lines would be created from those unique point codes and wouldn't cross over each other.

If this is not possible, that's fine I will simply add more input parameters.

0 Likes
Accepted solutions (1)
4,671 Views
7 Replies
Replies (7)
Message 2 of 8

ecfernandez
Mentor
Mentor

Hi @seanp.fahey, I would create a String Variable to keep the custom code that the user will enter. The user would have to enter that code as a String Input Parameter. Then, the assignation process for the code would depend on an "If condition" that would evaluate if the subassembly is inserted on the left or right side of the main assembly (Side=Right). Depending on this, the value for the variable would be set using a "Set Variable Value," and finally, the variable would have to be placed into the "point code" field of the point that you want to code.

Custom CodeCustom Code

Left sideLeft sideRight sideRight side

 

I hope this helps. I attach the PKT file as a compressed ZIP for you to check what I did.

Best regards!

 

 

 

Camilo Fernández

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

EESignature

LinkedIn
Message 3 of 8

RonaldBrañez
Advocate
Advocate
Accepted solution

Hi @seanp.fahey ,

Adding to what @ecfernandez already said, you could also simply create the Define variables with the name CustomCodeVariable of type string, and in the default value, you could write the following code:

 

If (Side = Left, String.concat ("Left -", CustomCode), String.concat ("Right -", CustomCode))

 

and continues with the corresponding geometry, assigning to the code box, the variable previously defined.

 

RonaldBrañez_1-1614627046648.png

 

 

RonaldBrañez_2-1614627159061.png

 

 

If this is not how you propose it (assign a side), and the subassembly follows an Offset Target Parameter which crosses the Base Line, then replace the CustomCodeVariable code with the following:

 

If (OffsetTargetParameter.Offset <0, String.concat ("Left -", CustomCode), String.concat ("Right -", CustomCode))

 

 

and continues with the corresponding geometry, assigning to the code box, the variable previously defined.

 

RonaldBrañez_4-1614627327321.png

 

 

RonaldBrañez_5-1614627423546.png

 

I leave you both subassemblies so you can see them better.

 

Regards.

Message 4 of 8

seanp.fahey
Advocate
Advocate
Thank you, this was helpful in getting me going in the direction I wanted. More specifically it was nice to know the code needed.
0 Likes
Message 5 of 8

kidznok
Advocate
Advocate

Hi,
Could you help me?
I would like to create Define Variable to returns full code for example:

kidznok_2-1660807142600.png

Message 6 of 8

RonaldBrañez
Advocate
Advocate

Hi @kidznok 

 

Verify that the Variable Type is set correctly (String)

 

RonaldBraez_0-1660825757451.png

Regards.

Message 7 of 8

ecfernandez
Mentor
Mentor

I coincide with @RonaldBrañez. Your code line looks OK. Check the variable type you are using to make it work.

Best regards!

Camilo Fernández

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

EESignature

LinkedIn
0 Likes
Message 8 of 8

kidznok
Advocate
Advocate

I have sth like that

kidznok_0-1660838776690.png


When I change Side to "zakres" like a option it works but with Side nope.

0 Likes