Selection set of ordinate dimensions

Selection set of ordinate dimensions

Travis.Biddle
Advocate Advocate
1,056 Views
7 Replies
Message 1 of 8

Selection set of ordinate dimensions

Travis.Biddle
Advocate
Advocate

I use the following line of code to set a selection set of all dimensions on a layer called "DIM".

 

(setq ssdim (ssget "x" '((0 . "DIMENSION") (8 . "DIM"))))

 

I want to use a similar line of code in a new lisp routine, but I only want the selection set to include ordinate dimension, not all dimensions.  Is this possible through lisp?

0 Likes
Accepted solutions (1)
1,057 Views
7 Replies
Replies (7)
Message 2 of 8

CodeDing
Advisor
Advisor

@Travis.Biddle ,

 

Try this filter, should do the trick:

(setq ssdim (ssget "x" '((0 . "DIMENSION") (8 . "DIM") (100 . "AcDbOrdinateDimension"))))

Best,

~DD

0 Likes
Message 3 of 8

Kent1Cooper
Consultant
Consultant

@CodeDing wrote:

....

(setq ssdim (ssget "x" '((0 . "DIMENSION") (8 . "DIM") (100 . "AcDbOrdinateDimension"))))

....


I don't have AutoCAD up to verify, but I think that won't work, because there will be a different 100-code entry in the entity data list [I think (100 . "AcDbEntity") or similar], which the filter will "see," before it gets to that one, which is near the end of the entity data list.  If I'm correct, it may be necessary to filter for all Dimensions and then step through the selection, keeping only those for which [if 'edata' is the entity data list for the Dimension under consideration]:

   (= (cdr (assoc 100 (reverse edata))) "AcDbOrdinateDimension")

returns T.  That reversing puts this entry before the other 100-code entry, to be the one found by the (assoc) function.

 

That's the kind of thing I've done to differentiate "heavy" 2D Polylines from 3D Polylines, both of which are of the (0 . "POLYLINE") class.

Kent Cooper, AIA
0 Likes
Message 4 of 8

ВeekeeCZ
Consultant
Consultant

Then this one.

'((0 . "DIMENSION") (8 . "DIM") (-4 . "&=") (70 . 6))

0 Likes
Message 5 of 8

Travis.Biddle
Advocate
Advocate

(setq ssdim (ssget "x" '((0 . "DIMENSION") (8 . "DIM") (100 . "AcDbOrdinateDimension"))))

 

This line of code selected all the dimensions.

0 Likes
Message 6 of 8

Travis.Biddle
Advocate
Advocate

Did I do this correct?

 

(setq ssdim (ssget "x" '((0 . "DIMENSION") (8 . "DIM") (-4 . "&=") (70 . 6))))

 

It returns NIL.  

0 Likes
Message 7 of 8

Travis.Biddle
Advocate
Advocate

I could achieve the same result by selecting all dimensions except the ordinate ones as well.  Is there a way to select only the linear dimensions, is that somehow easier?

0 Likes
Message 8 of 8

ВeekeeCZ
Consultant
Consultant
Accepted solution

@Travis.Biddle wrote:

Did I do this correct?

 

(setq ssdim (ssget "x" '((0 . "DIMENSION") (8 . "DIM") (-4 . "&=") (70 . 6))))

 

It returns NIL.  


Maybe your layer is different but this expression definitely works to select all ordinate dims.

0 Likes