Jump to content

Recommended Posts

Posted

What's wrong whit this?

 

(defun c:asd (/ ent obj x y y2 pos)
 (vl-load-com)
 (if (setq ent( entsel "\nSelecione: "))
   (progn
     (setq obj (vlax-ename->vla-object (car ent)))
     (setq cord (cdr ent))
     (setq x (car cord))
     (setq y (cdr cord))
     (setq y2 (= y -1))
     (setq pos (vla-get-alignment obj))
     (vla-put-backward obj 1)
     (vla-put-upsidedown obj 1)
     )
   )
 (if ( = pos 2)
   (vla-put-alignment obj 12)
   )
 (if ( = pos 0)
   (vla-put-alignment obj 14)
   )
 (vla-put-insertionpoint obj list(x y2 0))
 )

i can't change the insertionpoint of the text.

 

I'm very glad for any help or improviment on this code.

 

Thanks!

Posted
What's wrong whit this?

 

(defun c:asd (/ ent obj x y y2 pos)
 (vl-load-com)
 (if (setq ent( entsel "\nSelecione: "))
   (progn
     (setq obj (vlax-ename->vla-object (car ent)))
     (setq cord (cdr ent))
     (setq x (car cord))
     (setq y (cdr cord))
     (setq y2 (= y -1))
     (setq pos (vla-get-alignment obj))
     (vla-put-backward obj 1)
     (vla-put-upsidedown obj 1)
     )
   )
 (if ( = pos 2)
   (vla-put-alignment obj 12)
   )
 (if ( = pos 0)
   (vla-put-alignment obj 14)
   )
 (vla-put-insertionpoint obj list(x y2 0))
 )

i can't change the insertionpoint of the text.

 

I'm very glad for any help or improviment on this code.

 

Thanks!

 

Take a look at TextAlignmentPoint property

in the Help file

 

~'J'~

Posted

I read, but i can't fix that part, it's continues returning "; error: bad function: (800194.0 469602.0 0.0)"

Posted

Replace with this line:

(vla-put-insertionpoint obj (vlax-3D-point (list x y2 0)))

 

 

  1. You had your list defined incorrectly.
  2. You have to convert the list to a variant.

:)

Posted
Replace with this line:

(vla-put-insertionpoint obj (vlax-3D-point (list x y2 0)))

 

 

  1. You had your list defined incorrectly.
  2. You have to convert the list to a variant.

:)

 

 

alanjt, i have tryed this, and it wont work... continues returning

 

"error: bad argument type: numberp: (800059.0 469502.0 0.0)"

 

I don't know what's happening

Posted
I read, but i can't fix that part, it's continues returning "; error: bad function: (800194.0 469602.0 0.0)"

 

There are a lot of another basic mistakes here:

 

See how it will be works (tested slightly)

 

(defun c:asd (/ ent obj x y y2 pos)
 (vl-load-com)
 (if (setq ent( entsel "\nSelecione: "))
   (progn
     (setq obj (vlax-ename->vla-object (car ent)))
     (setq cord (cadr ent));; was (cdr ent)
     (setq x (car cord))
     (setq y (cadr cord));; was (cdr cord)
     (setq y2 (- y 1)) ; was (= y -1); bad syntax
     (setq pos (vla-get-alignment obj))
     (vla-put-backward obj 1)
     (vla-put-upsidedown obj 1)
     )
   )
 
 (cond (( = pos 0)
   (progn   
   (vla-put-insertionpoint obj (vlax-3d-point (list x y2 0)));was (vla-put-insertionpoint obj list(x y2 0))
   (vla-put-alignment obj 12)
   (vla-put-textalignmentpoint obj (vlax-3d-point (list x y2 0)));;added
   )
   )
 (( = pos 2)  
   (progn
     (vla-put-insertionpoint obj (vlax-3d-point (list x y2 0)));was (vla-put-insertionpoint obj list(x y2 0))
     (vla-put-alignment obj 14)
     (vla-put-textalignmentpoint obj (vlax-3d-point (list x y2 0)));;added
 )
)
())
 (princ)
 )

 

~'J'~

Posted

Understood, many thanks!!

 

I don't realize i need to change boot alingn and insertion point.

 

Many thanks fixo.

Posted
Understood, many thanks!!

 

I don't realize i need to change boot alingn and insertion point.

 

Many thanks fixo.

 

You're welcome,

Cheers :)

 

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