I am wondering if there is a way to make script that shows up in a schedule that will allow you to report a size for a MEP pipe fitting in a certain way for different fittings. I want to have one column to show sizes instead of 3 columns in case I have a reducer or a tee or wye. For example if I have a 4" elbow, I want it to show only the connection 1 diameter as 4". If I have a 4" tee I want it to say 4". If I have a reducer that is 4x3, I would like it to report in the 1 column as 4x3, but reporting the connection 1 and 2 diameter. I also would like to have a reducing tee that is 4x4x3 report in 1 column, but reports the Nominal connection diameter for 1, 2 & 3. Can this be done or am I out of luck? If this is confusing pleasel let me know.
Solved! Go to Solution.
Solved by mrivera. Go to Solution.
Here is what I am tring to do, but don't know how to have it just show the 6x6x4 on the combination or just 4 on the coupling.
Hi,
Try this formula
ND = Replace( "[NominalDiameter]", ".", "," ) Select Case "[PartType]" Case "TRANSITION" RESULT = CDbl(Split(ND, ";", -1, 0) (0))&" x "&CDbl(Split(ND, ";", -1, 0) (1)) Case "ELBOW" RESULT = CDbl(Split(ND, ";", -1, 0) (0))&" x "&CDbl(Split(ND, ";", -1, 0) (1)) Case "TEE" RESULT = CDbl(Split(ND, ";", -1, 0) (0))&" x "&CDbl(Split(ND, ";", -1, 0) (1))&" x "&CDbl(Split(ND, ";", -1, 0) (2)) Case "CROSS" RESULT = CDbl(Split(ND, ";", -1, 0) (0))&" x "&CDbl(Split(ND, ";", -1, 0) (1))&" x "&CDbl(Split(ND, ";", -1, 0) (2))&" x "&CDbl(Split(ND, ";", -1, 0) (3)) Case Else RESULT = CDbl(Split(ND, ",", -1, 0) (0)) End Select
This is the result, you can add other elements in the formula
Regards,
Vitaly
That worked, thanks. The only problem I have now is that it adds 0's to the end. I can't figure out what setting that is.
Well I'm trying different things to get it to work correctly, but nothing yet. I will keep on working on it. I really appreciate the help on solving the problem of reporting the sizes. Thanks again for helping. Where did you learn how to use the VBA scripting?
I get most of my general VBScript information from this site. http://www.w3schools.com/vbscript/ While it does not contain any AutoCAD MEP specific information it is good for general stuff.
Hi Keith,
If you are the administrator of this topic, please correct Kudos
The solution is this script Try this formula ))
Best regards,
Vitaly