Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
kpennell
Posts: 533
Registered: ‎04-14-2004
Message 1 of 6 (255 Views)
Accepted Solution

Modify Table Column Widths

255 Views, 5 Replies
04-26-2012 07:42 AM

Does anyone know how to modify the column widths of an ACAD_TABLE?

 

I have known co-ordinates that I want each grip for the table to be set at.  I can't just copy and paste the table from drawing to drawing.  Each table of each drawing have different textual values, and the column widths will best be sized for each text value.

 

Thanks,

KP

If using dxf methods (entget, subst, and entmod), then the column width dxf is 142 code.

 

If accessing object methods, use the setcolumnwidth method.

 

(setq o (vlax-enamd->vla-object (car(entsel))))  ;;select table and get table object.

 

(vla-setcolumnwidth o 0 4);;set the first column to 4 units wide.

*Expert Elite*
dbroad
Posts: 1,627
Registered: ‎08-16-2007
Message 2 of 6 (246 Views)

Re: Modify Table Column Widths

04-26-2012 05:08 PM in reply to: kpennell

If using dxf methods (entget, subst, and entmod), then the column width dxf is 142 code.

 

If accessing object methods, use the setcolumnwidth method.

 

(setq o (vlax-enamd->vla-object (car(entsel))))  ;;select table and get table object.

 

(vla-setcolumnwidth o 0 4);;set the first column to 4 units wide.

Distinguished Mentor
gasty1001
Posts: 581
Registered: ‎04-11-2010
Message 3 of 6 (239 Views)

Re: Modify Table Column Widths

04-26-2012 09:59 PM in reply to: kpennell
Distinguished Contributor
kpennell
Posts: 533
Registered: ‎04-14-2004
Message 4 of 6 (226 Views)

Re: Modify Table Column Widths

04-27-2012 03:52 AM in reply to: kpennell

I get the following error using the "SetColumnWidth" method.

 

Select object: ; error: no function definition: VLAX-ENAMD->VLA-OBJECT

 

For anyone doing a search on this, it should read (setq o (vlax-ename->vla-object (car(entsel))))

 

Using this method is way simpler than stepping through the 142 dxf codes.

 

Thank you so much.

 

KP

Distinguished Mentor
gasty1001
Posts: 581
Registered: ‎04-11-2010
Message 5 of 6 (218 Views)

Re: Modify Table Column Widths

04-27-2012 05:05 AM in reply to: kpennell

Hi,

 

1.- (vl-load-com) 

2..-(vlax-ename->vla-object (car(entsel)))

 

Gaston Nunez

Distinguished Contributor
kpennell
Posts: 533
Registered: ‎04-14-2004
Message 6 of 6 (216 Views)

Re: Modify Table Column Widths

04-27-2012 05:09 AM in reply to: kpennell

Yeah, the vl-load before is necessary.

 

Thanks for adding that, for the solution to the problem.

 

KP

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!