Jump to content

What is DXF CODE 20 used for?


dallion

Recommended Posts

We can use the DXF Code 10 and 11 to filter entities by X Coordinate in a selection set:

 

              (ssget "_X"
                   (list
                      '(0 . "LINE")
                      '(-4 . "<OR")
                          '(-4 . "=") (cons 10 p)
                          '(-4 . "=") (cons 11 p)
                      '(-4 . "OR>")
                       (if (= 1 (getvar 'cvport))
                           (cons 410 (getvar 'ctab))
                          '(410 . "Model")
                       )
                   )
               )

This returns a selection set containing all lines with an X Coordinate matching the X Coordinate of point p.

 

The documentation says code 20 and 21 would be the corresponding Y Coordinate and 30 and 31 would be the Z Coordinates, but we get

 


error: bad SSGET list value 

 

using those instead of 10 and 11. .NET code similarly throws exceptions when 20 is used.

 

We can see with (entget(car(entsel))) lines don't contain code 20 or 21. What is DXF Code 20, etc. used for?

Link to comment
Share on other sites

What is DXF Code 20, etc. used for?

 

It is not used.

 

You can filter for Lines in the active space whose start or end point Y value is equal to that of point p by using the following relational filter code (similar for Z value; see the 'Relational Tests' section of the developer documentation).

(ssget "_X"
   (list
      '(0 . "LINE")
      '(-4 . "<OR")
          '(-4 . [color=red]"*,="[/color]) (cons 10 p)
          '(-4 . [color=red]"*,="[/color]) (cons 11 p)
      '(-4 . "OR>")
       (if (= 1 (getvar 'cvport))
           (cons 410 (getvar 'ctab))
          '(410 . "Model")
       )
   )
)

Link to comment
Share on other sites

Point values 10 20 and 30 differ when referring to DXFOUT / DXFIN / DXF File operations vs DXF Group 10 in entity data.

 

An external ACSII .dxf file containing a line form 11,8,0 to 17,12,0 would look like this:

 

ENTITIES
 0
LINE
 5
3E
100
AcDbEntity
 8
0
100
AcDbLine
10
11.0
20
8.0
30
0.0
11
17.0
21
12.0
31
0.0
 0
ENDSEC

 

Put 10(x) 20(y) 30(z) together to form the entity's Group 10 value.

 

Notice the 11 21 31 follow the same rules, as does any point value that I know of.

 

HTH -David

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...