Jump to content

How can I make this insert at the right scale?


Recommended Posts

Posted

Well i really hope thats the case and i havent wasted your time.

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    24

  • BLOACH85

    21

  • fixo

    7

Top Posters In This Topic

Posted

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)

Posted

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)

Posted

ok so apparently the vla-set commands on my last post do not exists

so....back to step 1 i guess

Posted

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

Posted
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'~

Posted

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'~

Posted

You're quite welcome

Hint

I think your sharp brain is ready to learn C++/ObjectARX

at the same time, trust me :)

Try start

 

~'J'~

Posted

Thank you for your kind words Fixo, I just don't want to confuse myself :)

 

Do you think C++/Object ARX is the way to go, or should I perhaps try to learn Java?

Posted

I don't know, sorry

Ask about the big brothers from this forum,

say TT or MP or LE :)

 

~'J'~

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