Correctly Handling Stop Tubes in Instrux code


[ Follow Ups ] [ Post Followup ] [ Technasales Usegroup Postings ] [ FAQ ]

Posted by Ralph Vince on November 22, 2000 at 09:17:02:

Correctly handling stop tubes, given all of the variable associations, as well as adders with their associations, for metric and imperial, can be very complicated. This problem has been solved, and the step by step solution is included herein.


1. make sure you have a setname for the variable and the name for stoptube, in instrux or the main program file. For example:

setname _y stoptube

2. Specify your associations. For standard nfpa cylinders these are typically (sometimes this may vary slightly in variable name from one manufacturer to the next):

//single rod use these:
assoc c y
assoc c zb
assoc c xs
assoc c xt
assoc c xc
assoc c xd
assoc c w
assoc c wf
assoc c zf
assoc c zj
assoc c zt
assoc c xg
assoc c xj
assoc c xi
assoc stoptube stroke


//double rod use these:
assoc c zb delta*2
assoc c zm delta*2
assoc c y
assoc c xs
assoc c xt
assoc c xc
assoc c xd
assoc c w
assoc c wf
assoc c zf
assoc c zj
assoc c zt
assoc c xg
assoc c xj
assoc c xi
assoc stoptube stroke


//special association if female rod: (aren't there always!)
assoc c a

The above assumes you have an underscore variable that has been 'setnamed' to 'stoptube' and one to 'stroke'. If you are using differerent names, adjust the code accordingley.

Important. This step of associating variables should be done BEFORE you even read in the data tables.


3. After you read in the data tables, before you set other variables, augment the variables read in from the tables. Do so with the following code:

assign ~x c
//the 0 in the next line indicates imperial data tables:
augment augment var 0
if ~x=c
[
assign c[1] 0
]
if ~x!c
[
//if c changes, make c[1] be the difference so we know how much of c is not wrench flats
assign c[1] c-~x
]


To see this specifically, refer the the Advance Automation project, the file instrux.i

4. Npw, to draw the unthreaded portion of the rod then, use:

//for single rod ends use:

object rod_no_thread
flatrod mm d origx-.5*_g-g-_j-_v-c[1]-.5*(c-c[1]) origy origz c-c[1]
if c[1]>0
[
conic cnoflat 1 1 1 1 origx-.5*_g-g-_j-_v-.5*c[1] origy origz mm*.5 mm*.5 c[1] 0 0 0 16 rod_no_thread rod_no_thread rod_no_thread
]

//and for double rod ends use:

object rod_no_thread
flatrod mm d origx-.5*_g-g-_j-_v-c[1]-.5*(c-c[1]) origy origz c-c[1]
if c[1]>0
[
conic cnoflat 1 1 1 1 origx-.5*_g-g-_j-_v-.5*c[1] origy origz mm*.5 mm*.5 c[1] 0 0 0 16 rod_no_thread rod_no_thread rod_no_thread
]
conic rod_nothread_rear 1 1 1 1 origx+.5*_g+g+_j+_v+.5*_d origy origz mm*.5 mm*.5 _d 0 0 0 12 rod_no_thread rod_no_thread rod_no_thread
object rod_no_thread_rearflat
flatrod mm d origx+.5*_g+g+_j+_v+_d+c[1]+.5*(c-c[1]) origy origz c-c[1]
if c[1]>0
[
conic cnoflat 1 1 1 1 origx+.5*_g+g+_j+_v+_d+.5*c[1] origy origz mm*.5 mm*.5 c[1] 0 0 0 16 rod_no_thread rod_no_thread rod_no_thread
]

This code will draw the unthreaded portions for you correctly, given adders and stop tubes. Again, to se this in practivce, view the Advance Autoamation series I project code.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Technasales Usegroup Postings ] [ FAQ ]