Fabrication CADmep™ > CADmep™ Worksheets & Reports

Elevations on Worksheets

<< < (8/8)

jmerch:
Here is the final script for anyone else.  Thanks to Don, Jabo, and Dave for the input and putting this together!


--- Code: ---dim quote = ascii(34)
dim ft = ascii(39)
dim cr = ascii(10)

select item.cid
  case 838,8382,8384

dim sBtm = item.endlocation(1,"Btm")
dim len = len(sBtm)
dim pt = instr(1,sBtm,".")
pt = pt-1
dim getfrac = right(sBtm,(len-pt))
dim inch = left(sBtm,pt)
dim frac = 0
dim getfeet = number(inch)/12
dim feet = rounddown(getfeet)
dim decinch = (getfeet - feet)*12

if getfrac < .9375 then
        select number(getfrac)
            case > .8124
                frac = "7/8"
            case > .6874
                frac = "3/4"           
            case > .5624
                frac = "5/8"           
            case > .4374
                frac = "1/2"                       
            case > .3124
                frac = "3/8"           
            case > .1874
                frac = "1/4"           
            case > .0624
                frac = "1/8"
            case > .9374
                frac = ""
                inch = inch + 1
        end select
end if

rem debug "sBtm - " + sBtm +cr+cr+ "len sBtm - " + len +cr+cr+ "pt sBtm - " + pt +cr+cr+ "getdec/getfrac - " + getfrac +cr+cr+ "inch - " + inch +cr+cr+ "frac - " + frac +cr+cr+ "getfeet - " + getfeet +cr+cr+ "feet - " + feet +cr+cr+ "decinch - " + decinch

dim BtmElev
if feet > 0 then
BtmElev = feet + ft + "-" + decinch + " " + frac + quote
else
BtmElev = decinch + " " + frac + quote
end if

rem debug BtmElev

item.customdata["Hanger Wksht Elevation"].value=BtmElev
endselect
--- End code ---

cadmium:
This is great, I cant believe I missed this thread.  Can anyone help me do one more custom field, maybe added to this script that just adds item dimension list 6 and 7?
This would give me a total rod length that I could put on our labels.

dopefish:
Tried running this and got an error on line 52. "value=" was highlighted.

myohalem:
did you ever fix that line 52 error?

dopefish:
Hey Mo. Let me take a look at my script for this and see what I did. But I did get this working at some point.

Navigation

[0] Message Index

[*] Previous page

Go to full version