Jump to content

Recommended Posts

Posted

Hi,

 

I'm trying to use visual lisp to automate setting up viewports. The trouble is when I try to change the centre. As a basic example

(setq entv (vlax-ename->vla-object (car (entsel))))
(vla-put-center entv '(500.0 200.0 0.0))

returns the following error:

; error: lisp value has no coercion to VARIANT with this type: (500.0 200.0 0.0)

(vla-get-center entv)

Returns:

#

Posted

vlax-make-safearray or vlax-make-variant?

I haven't used either function before and couldn't get it to work.

Posted

hi missing

(vla-put-center entv ([color="blue"]vlax-3d-point[/color]'(500.0 200.0 0.0)))

Posted
hi missing

(vla-put-center entv ([color=blue]vlax-3d-point[/color]'(500.0 200.0 0.0)))

 

I thought it would be simple :D

 

:beer:

Posted

FWIW, You can also omit the list format & z-value, e.g.:

(vla-put-center entv (vlax-3D-point 500 200))

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