Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Relation for Balloon BOM qty

MNPIKE

New member
Guys -


I am attempting to write a relation that displays the qty of a component next the the balloon when the qty is greater than one.


I tried something like this, but I get errors


BAL_QTY = rpt.qty


If BAL_QTY=1


BAL_QTY =""


IF BAL_QTY=>1


BAL_QTY= BAL_QTY +"X"


ENDIF


ENDIF


I then call out BAL_QTY in a custom balloon.


Any help is much appreciated.
 
It looks as if you syntax is incorrect in your relation. Try something like the following.


bal_qty=rpt_qty


if rpt_qty==1


bal_qty = " "


else


bal_qty = rpt_qty


endif
 
also interested in this but the above relations did not work


have created a BOM balloon symbol that contains the variables "\index\" and "\qty\" and this works fine


where do you enter the relations


is the field "bal_qty" a user defined parameter


any tips on fine tuning this to work much appreciated


regards





Dave R
 
MNPIKE,


Computers are logical (although we sometimes find they're not ...), and programming is also. You made 2 basic errors.


The program you wrote says, humanly : if the quantity is 1 do something. The next instruction says : if the quantity is 1 or more do something else. The error is that the second instruction always gets executed, which makes the first instruction useless, the result is always overwritten.


The second programming error is in the use of your variables. Although you can alter the value of a variable in a testroutine, you should be aware that it's changed after the test, so you can't use the value to do a test again that relies on the original value. And you should never ever alter the properties of a variable (although Basic will allow you to do so). Your bal_qty is a number at first, assigning "" to it alters it to an empty textstring, which is something entirely different. If you want to create a string that depends on a test then you should use a second parameter for building the text.


Hope this is clear.


Alex
 

Sponsor

Articles From 3DCAD World

Back
Top