Jump to content

How can I make this insert at the right scale?


BLOACH85

Recommended Posts

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    24

  • BLOACH85

    21

  • fixo

    7

Top Posters In This Topic

I found this @

http://www.cadtutor.net/forum/archive/index.php/t-6684.html

but it scales a block not a vla object would it work?


;; Match Block 
;; Matches properties from doner block to selected blocks
;; Properties include x,y,z scale factor, rotation, color, layer,
;; linetype, and linetypescale
(defun c:mb (/ srcblk ensel srcobj prop blkobj blk color linetype
rotation x-scale y-scale z-scale layer linetypescale lineweight plotstylename
)

(if (setq srcblk (car (entsel "\nSelect source block: ")))
(setq srcobj (vlax-ename->vla-object srcblk)
x-scale (vla-get-xscalefactor srcobj)
y-scale (vla-get-yscalefactor srcobj)
z-scale (vla-get-zscalefactor srcobj)
rotation (vla-get-rotation srcobj)
color (vla-get-color srcobj)
linetype (vla-get-linetype srcobj)
layer (vla-get-layer srcobj)
linetypescale (vla-get-linetypescale srcobj)
lineweight (vla-get-lineweight srcobj)

)
)

(while (progn
(prompt "\nSelect destination block: ")
(setq blk (ssget "+.:E:S"))
)
(setq blkobj (vlax-ename->vla-object (ssname blk 0)))

(prompt "\*** Got one. ***")
(vla-put-xscalefactor blkobj x-scale)
(vla-put-yscalefactor blkobj y-scale)
(vla-put-zscalefactor blkobj z-scale)
(vla-put-rotation blkobj rotation)
(vla-put-Color blkobj color)
(vla-put-Linetype blkobj linetype)
(vla-put-layer blkobj layer)
(vla-put-linetypescale blkobj linetypescale)
(vla-put-lineweight blkobj lineweight)


)
(princ)
)
(prompt "\*** Match Block Loaded, Enter MB to run. ***")
(princ)

Link to comment
Share on other sites

I use Annotative object scale on every drawing. so if i have a current scale set why could we not use

 

 

(setq tb(vlax-ename->vla-object(car(entsel))))
(vla-get-XEffectiveScaleFactor 'tb) 
(vla-get-XScaleFactor 'tb)
(vla-set-XEffectiveScaleFactor 'tb)
(vla-set-XScaleFactor 'tb)

Link to comment
Share on other sites

vla-set-...xxx does not exist I don't think,

 

the opposite of vla-get is vla-put

 

So maybe something like:

 

vla-put-XScaleFactor...

If you need to scale this table uniformly try the following one:

(setq pt (getpoint "\nSpecify base point: ")
       dblscale (getreal "\nSpecify scale factor: ")
)
(vla-scaleentity tb (vlax-3d-point pt) dblscale)

 

~'J'~

Link to comment
Share on other sites

Ok, buddy

 

Type (vl-load-com) in the command line then

Open VLIDE

and then

type vla-put-xscalefactor there then select it and press "Apropos" button

(red "(A)" in main menu) and you will be happy

 

From help:

vla-put-xscalefactor

Specifies the X scale factor for the block or external reference (xref).

 

~'J'~

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...