Jump to content

Troubles with vla-addleader...


Lee Mac

Recommended Posts

I am trying to use "vla-addleader", but keep receiving an error:

 

BAD ARGUMENT TYPE: VLA-OBJECT #
I am using the following code:

 

   (vla-addleader spc VertVar
     (vla-addMText
   (vlax-3d-Point
     (polar pt2 0 (/ (getvar "TEXTSIZE") 2.0)))
   (- (caadr tBox) (caar tBox)) tStr)
     acLineWithArrow)

Where, spc is the space retrieved, VertVar is a variant, like this:

 

   (setq Verts (apply 'append (list pt1 pt2))
     VertVar (vlax-make-variant
           (vlax-safearray-fill
             (vlax-make-safearray
           vlax-vbdouble
           (cons 0 (1- (length Verts))))
             Verts)))

and "(- (caadr tBox) (caar tBox))" is a number (real)

 

and tStr is just a string.

 

I can't work out what is going wrong :(

 

Thanks for your time

 

Lee

 

 

EDIT: Just seen I missed a "spc" from the MTEXT expression :(

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