Discussion:
Creating a Custom autolisp to select & filter dimension types
(too old to reply)
Billy
2003-09-23 12:20:45 UTC
Permalink
Hello,

I am currently a user of Autocad 2000 and would like to create a
custom Autolisp function which will allow me to select a group of
objects and only select the dimension types that I want (ie. rotated,
ordinate, radial, diameter...but not angles). This is kind of like the
Qselect function except that Qselect does not allow you to select many
types of dimensions as the filter criteria. I am new to autolisp and
don't have any experience with it.

I have tried the following command in autocad:

(setq sel1 (ssget '((0 . "DIMENSION"))))

This allows me to select all Dimension types. Does anybody know how I
can specify which types of dimensions I can select (ie. rotated,
ordinate, radial...etc.) ?

Any help would be greatly appreciated,
Thanks

Billy Chan
Tom Berger
2003-09-23 12:50:23 UTC
Permalink
Post by Billy
(setq sel1 (ssget '((0 . "DIMENSION"))))
This allows me to select all Dimension types. Does anybody know how I
can specify which types of dimensions I can select (ie. rotated,
ordinate, radial...etc.) ?
It would be nice if it would be possible to use
(ssget '((0 . "DIMENSION") (100 . "AcDbAlignedDimension")))
to filter aligned dimensions, but unfortunately you can't.

You need to make a function which looks for all dimensions in your
selection set and checks for the presence of (100 .
"AcDbAlignedDimension") or (100 . "AcDb3PointAngularDimension") and so
on. This is easy to do.

Tom Berger
--
ArchTools: Architektur-Werkzeuge für AutoCAD (TM)
ArchDIM - architekturgerechte Bemaßung und Höhenkoten
ArchAREA - Flächenermittlung und Raumbuch nach DIN 277
Info und Demo unter http://www.archtools.de
Billy
2003-09-23 17:15:01 UTC
Permalink
Post by Tom Berger
Post by Billy
(setq sel1 (ssget '((0 . "DIMENSION"))))
This allows me to select all Dimension types. Does anybody know how I
can specify which types of dimensions I can select (ie. rotated,
ordinate, radial...etc.) ?
It would be nice if it would be possible to use
(ssget '((0 . "DIMENSION") (100 . "AcDbAlignedDimension")))
to filter aligned dimensions, but unfortunately you can't.
You need to make a function which looks for all dimensions in your
selection set and checks for the presence of (100 .
"AcDbAlignedDimension") or (100 . "AcDb3PointAngularDimension") and so
on. This is easy to do.
Tom Berger
Hi Tom,

Thank you for your reply and input. You will have to excuse my
inexperience with AutoLISP and it's syntaxes. What does group code 100
mean? How is it used in conjunction with the ssget function?

What does it mean to include these lines into the ssget command?:
(100 . "AcDbAlignedDimension") or (100 . "AcDb3PointAngularDimension")

If you could please elaborate, that would be great!
Thanks,

Billy Chan
Tom Berger
2003-09-23 18:18:15 UTC
Permalink
Post by Billy
Thank you for your reply and input. You will have to excuse my
inexperience with AutoLISP and it's syntaxes. What does group code 100
mean? How is it used in conjunction with the ssget function?
As I already tols you: you can't use it in a SSGET filter list, as it
isn't a unique dxf code (try (entget (car (entsel))) to see the dxf
definition of a dimension entity - there are multiple "100" groups).
Create a selection set filtering for dimensions:
(setq sset (ssget '((0 . "DIMENSION"))))

Then step thru all the entities in your selection set and check for
the presence of a (100 . "AcDbAlignedDimension") or a (100 .
"AcDb3PointAngularDimension") group. Best is to do this in a COND, and
to build new selection sets for the different types of dimensions.

Tom Berger
--
ArchTools: Architektur-Werkzeuge für AutoCAD (TM)
ArchDIM - architekturgerechte Bemaßung und Höhenkoten
ArchAREA - Flächenermittlung und Raumbuch nach DIN 277
Info und Demo unter http://www.archtools.de
Loading...