Lee Chu Chu Posted July 24, 2014 Posted July 24, 2014 Is there any way in LISP to insert a block with specific scales for the different axes? ie, 100 for x-axis, 50 for y-axis and 100 in z-axis. I don't want to see dialog boxes, I want to be able to scale the axes in lisp. Quote
hanhphuc Posted July 24, 2014 Posted July 24, 2014 Lee Chu Chu said: Is there any way in LISP to insert a block with specific scales for the different axes? ie, 100 for x-axis, 50 for y-axis and 100 in z-axis. I don't want to see dialog boxes, I want to be able to scale the axes in lisp. InsertBlock Method Signature RetVal = object.InsertBlock(InsertionPoint, Name, Xscale, Yscale, ZScale, Rotation [, Password]) Example: (vl-load-com) (vla-InsertBlock (vla-get-modelspace(vla-get-ActiveDocument(vlax-get-acad-object))) (vlax-3d-point '(0 0 0)) "C:\\BLOCK.dwg" 100. 50. 100. 0.0 ) ; make sure "BLOCK.dwg" is valid name & path Quote
David Bethel Posted July 24, 2014 Posted July 24, 2014 Maybe : (entmake (list (cons 0 "INSERT") (cons 2 "BLOCKNAME") (cons 6 "BYLAYER") (cons 8 "0") (cons 10 (list 0.0 0.0 0.0)) (cons 39 0.0) (cons 41 1.0) ;;; X AXIS (cons 42 1.0) ;;; Y AXIS (cons 43 1.0) ;;; Z AXIS (cons 44 0.0) (cons 45 0.0) (cons 50 0.0) (cons 62 256) (cons 70 0) (cons 71 0) (cons 210 (list 0.0 0.0 1.0)))) The BLOCK table definition must exist prior to making the (entmake) call. -David Quote
Lee Chu Chu Posted July 24, 2014 Author Posted July 24, 2014 (edited) What about inserting the block at a specific point? Everytime I (setq pnt getpoint) and then call it up in the vlax-3d-point function, I keep getting errors like this. "Error: lisp value has no coercion to VARIANT with this type: (num1,num2, num3) Edited July 25, 2014 by Lee Chu Chu Quote
Lee Chu Chu Posted July 25, 2014 Author Posted July 25, 2014 Nope, don't speak any other languages besides English. Lol. But I figured it out. Simply used -INSERT. 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.