lisp to create a dimension from broken dimension

lisp to create a dimension from broken dimension

Anonymous
Not applicable
6,400 Views
23 Replies
Message 1 of 24

lisp to create a dimension from broken dimension

Anonymous
Not applicable

I have some drawings where the dimensions have been exploded and i am trying to build a lisp where i can rebuild them.  What is would like to be able to do is pick all the exploded lines and arrows to be removed.  Then pick the text to be removed.  Then pick the new extension line origins, then place the final location for my new dimension (dimalign) and have the text replace with the dimension replaced with the text i erased from the old exploded dimension.  Can anyone help me modify what I have below to make this work?   thx

 

(defun c:D11 (/ lead)

(command "_.LAYER" "_new" "DIM" "")

(command "_.layer" "_color" "6" "DIM" "")

(setvar "clayer" "dim")

(command "dimstyle" "r" "AA DIM I")

(setvar 'osmode 759)

(setq lead (ssget))

(command "__dimlinear" "\\" "\\" "\\")

(command "erase" lead "")

  (princ)

)

0 Likes
Accepted solutions (2)
6,401 Views
23 Replies
Replies (23)
Message 21 of 24

Anonymous
Not applicable

this has worked perfect for my up until today.  now when i run it I get this "; error: bad argument type: lselsetp nil"  does anyone know why this would change?

 

thanx

0 Likes
Message 22 of 24

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

this has worked perfect for my up until today.  now when i run it I get this "; error: bad argument type: lselsetp nil"  does anyone know why this would change? ....


 

Something that wants to be fed a selection set is getting nothing [nil].  Are the pieces you're selecting on a locked Layer?  Or did the selection not include any Text/Mtext  object(s)?  Either would cause that.  [It could be made to check whether appropriate un-locked things were selected before proceeding, if this is likely to happen at times.]

Kent Cooper, AIA
0 Likes
Message 23 of 24

Anonymous
Not applicable

that's exactly what it was.  there was no provision for Mtext selection.  i added this and it works perfect.

 

thanks for you help

0 Likes
Message 24 of 24

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....  there was no provision for Mtext selection.  i added this and it works perfect. ....


 

[Then you must have still been using the code from Message 13, not the upgrade in Message 19, which added that.]

Kent Cooper, AIA
0 Likes