Creating a Custom autolisp to select & filter dimension types

Discussion in 'AutoCAD' started by Billy, Sep 23, 2003.

  1. Billy

    Billy Guest

    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
     
    Billy, Sep 23, 2003
    #1
  2. Billy

    Tom Berger Guest

    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
     
    Tom Berger, Sep 23, 2003
    #2
  3. Billy

    Billy Guest

    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
     
    Billy, Sep 23, 2003
    #3
  4. Billy

    Tom Berger Guest

    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
     
    Tom Berger, Sep 23, 2003
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.