Jump to content

Inserting Block with different scaled axes.


Lee Chu Chu

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Lee Chu Chu
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...