Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selecting ONLY vertical dimensions

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
rocks89
1924 Views, 5 Replies

Selecting ONLY vertical dimensions

The title says it all, Im trying to find a way to select just the vertical dimensions. Quickselect doesnt work because theres no difference between a vertical and a horizontal dimension, so i was wondering if there was a LISP or something else i could do to acomplish this.

 

Thanks

5 REPLIES 5
Message 2 of 6
CADaSchtroumpf
in reply to: rocks89

Perhaps this !

 

(sssetfirst nil (ssget (list '(0 . "DIMENSION") '(-4 . "&=") '(70 . 0) (cons 50 (* pi 0.5)))))

 

Message 3 of 6
Kent1Cooper
in reply to: rocks89


@rocks89 wrote:

....Im trying to find a way to select just the vertical dimensions. ....


For linear dimensions other than Aligned, the DXF code 50 entry in the entity data is the direction of the dimension line.  In simplest terms, all those with bottom-up vertical direction should be findable with

 

(ssget "_X" (list (cons 50 (/ pi 2))))

 

But you would also want to find those with (cons 50 (* pi 1.5)) to get the top-down vertical ones.  That could be done with an <or> arrangement, which I may work out later if no one else beats me to it.

 

For Aligned ones, the 50 entry is always 0, and the angle is that between the definition points, which are the DXF code 13 & 14 entries.  Those may not be possible to find with (ssget) filtering.  But you could find all linear types of Dimensions, then step through and for those with (50 . 0.0) in them, check for the X components of the 13 & 14 entries being equal, to find the vertical ones.

 

The DXF 70 code entry holds the type of Dimension and whether its text is in the default location.  I figured out in connection with something else a while back that you can find out whether one is linear/rotated/aligned [the ones you want to consider], as opposed to angular/diameter/radius/ordinate [the ones you don't]:

 

(if (< (rem (cdr (assoc 70 EntityData)) 32) 2)

  (...then it's a linear, rotated or aligned dimension...)

)

 

Or you can check the ObjectName VLA property -- those you want to consider will be either "AcDbRotatedDimension" or "AcDbAlignedDimension".

Kent Cooper, AIA
Message 4 of 6
rocks89
in reply to: CADaSchtroumpf

Hey, thanks for the response, but im kindda new with this LISP things, Where shoul I paste that? a new text file? do I have to put some kind of title before it? and last question how do I activate it.. meaning what command o somenthing like.

 really apprecciate your help

Message 5 of 6
rocks89
in reply to: CADaSchtroumpf

It works like a charm! thanks a lot 

Message 6 of 6


@CADaSchtroumpf wrote:

Perhaps this !

 

(sssetfirst nil (ssget (list '(0 . "DIMENSION") '(-4 . "&=") '(70 . 0) (cons 50 (* pi 0.5)))))

 


I had thought that would need to include a (-4 . "<OR") logical grouping to include the possibility of (cons 50 (* pi 1.5)) if top-down vertical Dimensions are to be found, but I find that even those drawn from the top down have an upward definition of their direction, so that should find all of those of Rotated [linear/vertical/horizontal] type.

 

But it would need to have a logical "<OR" grouping to include (70 . 1) if Aligned Dimensions are to be included.  Maybe they don't need to find such Dimensions, but if so, I think those would need to be checked individually for whether their definition points align vertically, unless someone can figure out a way to cover that in relational testing in (ssget).  I'm having a hard time imagining that -- you can compare entries to fixed values, but I'm not sure you can compare them to each other, much less portions of them.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost