Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 I'm not sure what to put in. It should be a replacement of the vlax-3d-point? Quote
alanjt Posted May 12, 2010 Posted May 12, 2010 I'm not sure what to put in. It should be a replacement of the vlax-3d-point? (setq d2 (getdist p1 "\nSpecify box width: ")) ;; modified by Reid b. (setq d3 (getdist p1 "\nSpecify box length: ")) ;;by Reid b. Quote
Lee Mac Posted May 12, 2010 Posted May 12, 2010 Also, (distance p1 p2) d2 ___________________________________ (distance p1 p3) d3 ___________________________________ (angle (trans p1 1 0) (trans p2 1 0)) Additional Input req'd Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 alright I'm going crazy trying to figure out the 3d input thing. I keep getting an error saying it's a bad arguement 2d/3d input. I hate that I'm taking up your time. I wish there was a class here for this stuff Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 ; error: bad argument type: 2D/3D point: nil Quote
alanjt Posted May 12, 2010 Posted May 12, 2010 ; error: bad argument type: 2D/3D point: nil Ahh, I wasn't thinking about rotation. How are you determining that? If you don't have to change the rotation, just change: (angle (trans p1 1 0) (trans p2 1 0)) to 0. Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 Ahh, I wasn't thinking about rotation. How are you determining that? If you don't have to change the rotation, just change: (angle (trans p1 1 0) (trans p2 1 0)) to 0. I WAS CHANGING THE ROTATION BY (vlax-3d-point (trans p1 1 0)) blockname 1. 1. 1. [color=red]0.[/color] ;;<---- THIS Quote
alanjt Posted May 12, 2010 Posted May 12, 2010 Try this. It should also store your distance variables. UNTESTED (defun c:COMP1 (/ blockname p1) ;; Alan J. Thompson, 05.12.10 (vl-load-com) (setq blockname "1compartment") (if (and (or (tblsearch "block" blockname) (findfile (strcat blockname ".dwg")) (alert (strcat blockname " cannot be found!")) ) (setq p1 (getpoint "\nSpecify block insertion point: ")) (setq *COMP1:WD* (cond ((getdist (strcat "\nSpecify box width" (if *COMP1:WD* (strcat " <" (vl-princ-to-string *COMP1:WD*) ">: ") ": " ) ) ) ) (*COMP1:WD*) ) ) (setq *COMP1:LG* (cond ((getdist (strcat "\nSpecify box length" (if *COMP1:LG* (strcat " <" (vl-princ-to-string *COMP1:LG*) ">: ") ": " ) ) ) ) (*COMP1:LG*) ) ) ) ((lambda (block) (foreach x (vlax-invoke block 'GetDynamicBlockProperties) (cond ;; width ((eq (vla-get-propertyname x) "DISTANCE") (vla-put-value x (cond ((>= 0.125 (/ *COMP1:WD* 0.125)) 0.125) ((< 0.125 (setq num (/ *COMP1:WD* 0.125))) (* 0.125 (fix num))) (0.125) ) ) ) ;; length ((eq (vla-get-propertyname x) "DISTANCE1") (vla-put-value x (cond ((>= 0.125 (/ *COMP1:LG* 0.125)) 0.125) ((< 0.125 (setq num (/ *COMP1:LG* 0.125))) (* 0.125 (fix num))) (0.125) ) ) ) ) ) (vl-catch-all-apply (function (lambda () (vla-explode block) (vla-delete block)))) ) (vla-insertblock (if (or (eq acmodelspace (vla-get-activespace (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) ) ) ) (eq :vlax-true (vla-get-mspace *AcadDoc*)) ) (vla-get-modelspace *AcadDoc*) (vla-get-paperspace *AcadDoc*) ) (vlax-3d-point (trans p1 1 0)) blockname 1. 1. 1. 0. ) ) ) (princ) ) Quote
Lee Mac Posted May 12, 2010 Posted May 12, 2010 By the way, are you using the Visual LISP Editor to edit the LISP? Why not just use the deb u g g e r (can't believe it filters that) in that to determine the location of your error - it will save you from 'driving yourself crazy'... Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 Try this. It should also store your distance variables. UNTESTED Exactly what I wanted! Thank you No more questions on this thread from me Quote
alanjt Posted May 12, 2010 Posted May 12, 2010 By the way, are you using the Visual LISP Editor to edit the LISP? Why not just use the deb u g g e r (can't believe it filters that) in that to determine the location of your error - it will save you from 'driving yourself crazy'... Are you talking about the Debug pulldown? I can't run/test the routine since I don't have the block. All I can do is make sure my parens match. Would be nice if it checked syntax though. Exactly what I wanted! Thank you No more questions on this thread from me You're welcome. Enjoy. I guess you'll be combining my checks. Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 By the way, are you using the Visual LISP Editor to edit the LISP? Why not just use the deb u g g e r (can't believe it filters that) in that to determine the location of your error - it will save you from 'driving yourself crazy'... To be honest I never tried any of the tools in the Visual LISP editor. I was worried it was going to mess things up. Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 Point me in the right direction. I'll use all the advice you guys give me. Quote
Lee Mac Posted May 12, 2010 Posted May 12, 2010 Are you talking about the Debug pulldown? I can't run/test the routine since I don't have the block. All I can do is make sure my parens match. Would be nice if it checked syntax though. Sorry Alan, I was aiming my point at Reid - when he said he was going crazy trying to work out the error. Quote
Lee Mac Posted May 12, 2010 Posted May 12, 2010 Example of how to use the VLIDE's debugging capabilities... Make sure this is ticked, so that a break point will be set: Run the code, if there is an error, a break point will be set at the expression that throws the error. Check for the last break source using this: For everything else, have a good read of this. Lee Quote
alanjt Posted May 12, 2010 Posted May 12, 2010 Sorry Alan, I was aiming my point at Reid - when he said he was going crazy trying to work out the error. Ahh, OK. I wasn't sure, so I thought I'd respond to it anyway. Quote
Lt Dan's legs Posted May 12, 2010 Posted May 12, 2010 Thank you! You've been extremely helpful. Both of you have Quote
alanjt Posted May 12, 2010 Posted May 12, 2010 Thank you! You've been extremely helpful. Both of you have You're welcome. Enjoy. Quote
Lee Mac Posted May 12, 2010 Posted May 12, 2010 You're very welcome - I hope you can identify the errors in your programs easier now 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.