Custom Subassemblies Lesson 4 – Clever Coding and Variables

Your point/link/shape codes are critical for display purposes in section views etc. Effective code set styles can’t be setup if you have not coded your assembly. But you also need them to be able to generate surfaces, use quantity take off features and generate material take off reports.

If your not sure about point/link/shape codes, read the article here

So you want them to be easy to change, but hard to make a mess on the users side. For this reason, I suggest using the “sandwich” technique. Where every code utilizes the material code (the meat/salad) and has a prefix and a suffix (the bread)

The Prefix
Is generally used for staging/options and for intersection design subassemblies. This allows the user to quickly use the same subassembly twice, but not have the codes muddled because they are the same. So you could put OP1 (option 1) in front of all the codes. Then make an exactly copy of the subassembly change some of the parameters and change the code prefix to OP2 (option 2) and so on. This is a fantastic technique for generating multiple options in the one corridor!

User can specify the prefix for the subassembly
This prefix gets populated to all the codes! Rather than typing them one by one!

The suffix
Is used to denote the components of the subassembly. So DL = Daylight Point, CR = Crest Point, Top = Top Links. These are all common between the materials.

The Result
Is you end up getting a logical list like so

OP1_A_CR – point code
OP1_A_DL
OP1_A_Top – link code
OP1_A_Bot
OP1_B_CR
OP1_B_DL
Etc. etc.

Which makes life very easy

Setting up in Subassembly Composer
1. Start every CS by adding in these two flow charts first
image004image005

–  Variables will contain parameters that are common throughout the CS. So things like “Delta X for Layout” or “Depth for Layout”, the length used to display surface links on you’re assembly
–  Codes will be used to create all the ‘sandwiches” you need to code your subassembly effectively.

2. Double click the Variables Flow chart and begin by creating a zDFL as per below

Rather than typing the default value as 20, you could link this to an input parameter. Which means the user could control the “depth for layout” or how high the section looks when you attach it to an assembly in C3D.

3. Now go into the Codes Chart, in here we are going to create all the code pairs “sandwiches” that we will need. Lets consider Material D.

In material D we will have two surfaces (orange and red) that can be created. Top and Bottom (from 4 links), 4 Feature lines and 1 Shape Code, So:

Points
OP1_D_DL x 2 (its important to have only 2 feature lines created at either edge of a series of links, this way boundaries can be specified automatically)
OP1_D_CR x 2

Links
OP1_D_Top
OP1_D_Bot

Shape Codes
OP1_D (no need for suffixes here as we only have one material)

Shared Links and Points
Of course some of our links will share links with another material, like C and D and E and D, likewise with points. So how do we handle this confusion?

By systematically going through the materials we can create the variables quite quickly. You could do this by typing into each link/point. But I prefer to sort it all out in the codes flowchart then link the result back to the link/points at the end.

Starting with Material D you can define variables (you can start with A if you want!

Variable Code Result
pD_DL = cp +m_D + cs_DL OP1_D_DL
pD_CR_1 = cp + m_D + cs_CR + “,” + cp + m_C + cs_DL OP1_D_CR,OP1_C_DL
pD_CR_2 = cp + m_D + cs_CR + “,” + cp + m_E + cs_DL OP1_D_CR,OP1_E_DL
lD_Top_1 = cp + m_D + csl_T + “,” + cp + m_C + csl_B OP1_D_top,OP1_C_bot
lD_Top_2 = cp + m_D + csl_T + “,” + cp + m_E + csl_B OP1_D_top,OP1_E_bot
lD_Top_3 = cp + m_D + csl_T + “,” + cp + csl_T + “,” + cp + “SlopeOut” OP1_D_top,OP1_Top,OP1_SlopeOut
lD_Bot = cp + m_D + csl_B + “,” + cp + m_F + csl_B OP1_D_bot,OP1_F_top
pC_DL = …. Etc. etc..

Then systematically working through by material you will eventually have all these parameters you can call rather quickly. Making it a lot easier to code, as well as understand for the end user of the CS.

Go through and create the rest. then move on to %Lesson 5%

Loading

Facebooktwitterredditpinterestlinkedinmail

One thought on “Custom Subassemblies Lesson 4 – Clever Coding and Variables”

Comments are closed.