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.
Solved! Go to Solution.
Solved by RonaldBrañez. Go to Solution.
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.
I hope this helps. I attach the PKT file as a compressed ZIP for you to check what I did.
Best regards!
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.
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.
I leave you both subassemblies so you can see them better.
Regards.
Hi,
Could you help me?
I would like to create Define Variable to returns full code for example:
I coincide with @RonaldBrañez. Your code line looks OK. Check the variable type you are using to make it work.
Best regards!
I have sth like that
When I change Side to "zakres" like a option it works but with Side nope.