nate201 Posted October 30, 2008 Posted October 30, 2008 I am currently writing a program to calculate the weight of a material. I am having it use the area command. I don't know how to get that information after I run the command. I have it set up to prompt for points just like the area command. So, you choose your points and lets say the area command would normally return with Area = 9.000, Perimeter = 12.000. How can I use that information after I run the command in my program? Basically: (command "area" p1 p2 p3 p4 p1 "") Then I am multiplying the area by the thickness and then multiplying by .2835. I need to pull the area info so I can complete my formula (area * thickness * .2835) Also, Can I run the area command and let it get the user points like normal and then go back to my formula in the program? I am kinda new to this so im not sure. thanks Quote
nate201 Posted October 30, 2008 Author Posted October 30, 2008 im sorry figured it out. (getvar "area") ... so simple... why could I have typed that an hour ago Quote
wizman Posted October 30, 2008 Posted October 30, 2008 (command "area") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (apply '* (list (getvar 'area) thickness 0.2835)) Quote
nate201 Posted October 30, 2008 Author Posted October 30, 2008 thanks, I couldn't get that exactly to work, but got this: (defun C:lbs (/ wgt thk) (command "area") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (setq thk (getreal "\nEnter thickness: ") wgt (* (* thk (getvar "area")) 0.2835) ) (prin1 wgt) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.