LISP to explode dimensions in multiple AutoCAD drawings

LISP to explode dimensions in multiple AutoCAD drawings

bgalindo4TNYT
Explorer Explorer
1,205 Views
5 Replies
Message 1 of 6

LISP to explode dimensions in multiple AutoCAD drawings

bgalindo4TNYT
Explorer
Explorer

Hi, 
I would appreciate if someone could help me with a lisp to explode all dimensions in multiple drawings in AutoCAD.

I know exploding dimensions is not the best, however I have to do it for this specific project and I have a lot of drawings.

0 Likes
1,206 Views
5 Replies
Replies (5)
Message 2 of 6

Sea-Haven
Mentor
Mentor

There are a couple of ways basically you need to make a script of the dwgs you want to do the explode on do you want to make a copy of the dwgs also.

 

Are the dims only in Modelspace or in layouts as well ?

 

Using (ssget "X" '((0 . "DIMENSION'))) will find all dimensions then can explode.

 

Could be as simple as 

OPEN dwg1 (setvar 'ctab "Model")(command "Explode" (ssget "X" '((0 . "DIMENSION")))) close Y

OPEN dwg2 (setvar 'ctab "Model")(command "Explode" (ssget "X" '((0 . "DIMENSION"))) "") close Y

OPEN dwg3 (setvar 'ctab "Model")(command "Explode" (ssget "X" '((0 . "DIMENSION"))) "") close Y

0 Likes
Message 3 of 6

pbejse
Mentor
Mentor

@bgalindo4TNYT wrote:

Hi, 
I would appreciate if someone could help me with a lisp to explode all dimensions in multiple drawings in AutoCAD.


 

[ hinted by seahaven ]

Question: Are there dimensions on layout tabs on your drawings?

 

0 Likes
Message 4 of 6

devitg
Advisor
Advisor

It will be easy if you upload a sample.dwg , so all facts can be take in consideration.

0 Likes
Message 5 of 6

ronjonp
Mentor
Mentor

Answered HERE too...

Message 6 of 6

pbejse
Mentor
Mentor

@ronjonp wrote:

Answered HERE too...


	(entmakex (append (entget (vlax-vla-object->ename a))

I had a similar approach in mind, 

...
	  (setq dim (entget (ssname ss (Setq i (1- i)))))
		(setq db (tblobjname "BLOCK" (cdr (assoc 2 dim)))
	  		dobj (entget db))
		(while (and (setq db (entnext db)) (not ds))
		     (entmakex (append (entget db)(list (assoc 410  dim))))
		    )
	  	(entdel (ssname ss i))
...

 

@ronjonp 

Reason why I ask the OP of the location of the dims, is because of the eventual problems with entdel at layouts. Also going through entnext  has its own problem apparently when not use properlly.

 

 

0 Likes