Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
kpennell
Posts: 515
Registered: ‎04-14-2004
Message 1 of 4 (154 Views)

Move Tables in Drawings

154 Views, 3 Replies
01-22-2013 12:38 PM

I have a lot of drawings with two tables in them, and they are all over the place.

 

I'm able to change the columns widths using the following code:

 

(setq PipeList (vlax-ename->vla-object (car (entsel))))

 

(vla-setcolumnwidth PipeList 0 0.25)

(vla-setcolumnwidth PipeList 1 0.25)

(vla-setcolumnwidth PipeList 2 2.0)

(vla-setcolumnwidth PipeList 3 1.5)

(vla-setcolumnwidth PipeList 4 1.625)

(vla-setcolumnwidth PipeList 5 1.0)

(vla-setcolumnwidth PipeList 6 1.75)

 

I'm wondering if I could modify the assoc 10 value to a specific point of '(8.5 10.3675 0.0).

 

Thanks

KP

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 2 of 4 (139 Views)

Re: Move Tables in Drawings

01-22-2013 08:15 PM in reply to: kpennell

kpennell wrote:

I have a lot of drawings with two tables in them, and they are all over the place.

 

 

I'm wondering if I could modify the assoc 10 value to a specific point of '(8.5 10.3675 0.0).

 

Thanks

KP


Yes you can, but you mentioned you have TWO tables. which one goes to the specific point?

 

Distinguished Contributor
kpennell
Posts: 515
Registered: ‎04-14-2004
Message 3 of 4 (125 Views)

Re: Move Tables in Drawings

01-23-2013 03:37 AM in reply to: kpennell

How about a table with these specifics:

 

(cons 0 "ACAD_TABLE")(cons 1 "FITTINGS LIST")

 

; goes to (8.5 10.3675 0.0)

 

and a table wth these specifics:

 

(cons 0 "ACAD_TABLE")(cons 1 "PIPE LIST")

 

; goes to ((0.0625 10.3675 0.0)

 

Thanks

KP

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 4 of 4 (111 Views)

Re: Move Tables in Drawings

01-23-2013 05:42 AM in reply to: kpennell

kpennell wrote:

How about a table with these specifics:

(cons 0 "ACAD_TABLE")(cons 1 "FITTINGS LIST")

; goes to (8.5 10.3675 0.0)

(cons 0 "ACAD_TABLE")(cons 1 "PIPE LIST")

; goes to ((0.0625 10.3675 0.0)

 

Thanks

KP


 

(defun c:mtb ( / ss e n )
(if (setq ss (ssget "_X" '((0 . "ACAD_TABLE") (1 . "PIPE LIST,FITTINGS LIST"))))
	(repeat (setq i (sslength ss))
		(setq e (entget (ssname ss (setq i (1- i))))
	              n (cdr (assoc 1 e)))
		(entmod (subst (if (eq n "PIPE LIST")
				'(10 8.5 10.3675 0.0)
	                        '(10 0.0625 10.3675 0.0))
	                      (assoc 10 e) e))
	  ) 
	)
    (princ)
)

 HTH

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community