Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Table - insertion point

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
ProfWolfMan
1233 Views, 5 Replies

Table - insertion point

 

Hi,
I am just trying to create a table. 
Please see below code.
;----------------------------------------------
(defun fn-drawtable()
  (vl-load-com)
  (setq ms(vla-get-Modelspace(vla-get-ActiveDocument(vlax-get-acad-object))))  
  (setq mytable(vla-addtable ms (vlax-3d-point '(0 0 0)) 3 8 5 10)) )
;----------------------------------------------
It creates table with insertion point at upper left corner.
table help document also tells like that.
Now i want to change it's insertion point as upper right corner.
I tried with vla-put-direction. But i can not.
vla-put-FlowDirection changes it cells direction up and down only.
Please help me to change it's insertion point.

 

Thanks & Regards,
G
5 REPLIES 5
Message 2 of 6
phanaem
in reply to: ProfWolfMan

You can extract width of tabe (setq table_width (vla-get-width mytable)) and then move it to the left

 

(vla-Move mytable (vlax-3d-point '(0 0 0)) (vlax-3d-point (list (- table_width) 0 0)))

Message 3 of 6
ProfWolfMan
in reply to: ProfWolfMan

Yes. I already achieve by that way only.

But i want to know if there is any other properties or methods in table entity without using move or mirror kind of commands.

 

Thanks for your valuable time and comment.

Thanks & Regards,
G
Message 4 of 6
pbejse
in reply to: ProfWolfMan

you can try changing the insertionpoint, but then again its the same as moving  the table 

 

(vla-put-insertionpoint
      mytable
      (vlax-safearray-fill
        (vlax-make-safearray vlax-vbDouble '(0 . 2))
        (list (- 0 (vla-get-width mytable)) 0 0)))

 

Tell us again why you need the table to be on the upper right corner?

 

 

Message 5 of 6
ProfWolfMan
in reply to: pbejse

 

Ohhhhhhhhhhhh!
my mental block does this.thanks to clear that.
i can find upper left corner of table and now everything is ok.
No need to change insertion point of table.

 

Thanks & Regards,
G
Message 6 of 6
eurikadance
in reply to: pbejse

This is a great start for me, as I'm just starting with Visuallisp.  However, is there way to take this vla-move further by extracting the insertionpoint property of the table (vla-get mytable 'insertionpoint) and incrementally move the table by adding to either the x or y coordinate of the insertion point?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost