FazBear Posted October 7, 2008 Posted October 7, 2008 Hi all I Basically want to create a lisp to use on an AutoCAD table to adjust the style, width and height. I have had a look at the entity data to see if they were anything obvious but instantly realised that i was out of my depth. Has anyone done anything like this before? if so how?? Quote
ASMI Posted October 7, 2008 Posted October 7, 2008 It not so difficult. Define function like this to draw some table and retrieve ActiveX object of it: (defun AddNewTable() (vl-load-com) ; load Visual LISP extension (setq mSp(vla-get-ModelSpace ; get ModelSpace object (vla-get-ActiveDocument (vlax-get-acad-object))) iPt(getpoint "\nSpecify insertion point: ") ; specify insertion point nTbl(vla-AddTable mSp ; add new table in Model Space (vlax-3d-point iPt) ; in insertion point 5 ; 5 rows 3 ; 3 columns 25.0 ; row height 400.0) ; column width ); end setq ); end of AddNewTable You can to try it in command line: Command: (setq nTbl(AddNewTable)) Specify insertion point: #<VLA-OBJECT IAcadTable2 0e9f41fc> Now you can change any of table properties, for example add two columns with width 200.0 after 3-rd column: Command: (vla-InsertColumns nTbl 3 200.0 2) nil Or change height of 3 row to 100.0: Command: (vla-SetRowHeight nTbl 3 100.0) nil Look for all Table object properties and methods in ActiveX and VBA reference (inside Developer Help). Quote
FazBear Posted October 9, 2008 Author Posted October 9, 2008 Thank you for the detailed explaination. I'm a bit baffled tbh! All i want to be able to do is modify an existing AutoCAD table, looking at what you have posted it looks like it isn't going to be that easy. Problem is the AutoCAD table is generated by third party software (CadDuct) as a bill of materials, when the table inserts it inserts on standard Table style. I then have to place the table on the correct style then i have to resize the table, by selecting it then in the properties window input a new width and height. This is basically the process i want to automate in a lisp. So i guess all i need to know is how i can modify the width and hight of an existing AutoCAD table. Quote
Recommended Posts
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.