A couple of DXF code questions

Is there a DXF code that controls the color of mtext, if not how is this actually controlled. Also what controls the frozen/thawed state of a layer in individual viewports. Thanks Cliff

Reply to
Cliff Davis
Loading thread data ...

Are you referring to portions of MTEXT, or the MTEXT objects themselves? If you mean portions, I think control strings are added to the strings for such things as bold, underline, fonts, color, etc. I've never messed with it, but I think I remember seeing something about it years ago.

This is contained within XDATA of the viewports, for the application name "Acad". Below is an example, pasted from Acad:

Command: (entget (car (entsel)) '("Acad"))

Select object: ((-1 . ) (0 . "VIEWPORT") (330 . ) (5 . "3B7") (100 . "AcDbEntity") (67 . 1) (410 . "Property Plan") (8 . "DefPoints") (100 . "AcDbViewport") (10 19.1895 12.067 0.0) (40 .

28.4827) (41 . 18.448) (68 . 2) (69 . 2) (12 0.0 0.0 0.0) (13 0.0 0.0 0.0) (14 1.0 1.0 0.0) (15 0.0 0.0 0.0) (16 0.0 0.0 1.0) (17 1859.57 4337.08 0.0) (42 . 50.0) (43 . 0.0) (44 . 0.0) (45 . 1844.8) (50 . 3.14159) (51 . 3.14159) (72 . 10000) (341 . ) (341 . ) (341 . ) (341 . ) (341 . ) (90 . 32800) (281 . 0) (71 . 1) (74 . 0) (110 0.0 0.0 0.0) (111 1.0 0.0 0.0) (112 0.0 1.0 0.0) (79 . 0) (146 . 0.0) (-3 ("ACAD" (1000 . "MVIEW") (1002 . "{") (1070 . 16) (1010 1859.57 4337.08 0.0) (1010 0.0 0.0 1.0) (1040 . 3.14159) (1040 . 1844.8) (1040 . 0.0) (1040 . 0.0) (1040 . 50.0) (1040 . 0.0) (1040 . 0.0) (1070 . 0) (1070 . 10000) (1070 . 1) (1070 . 1) (1070 . 0) (1070 . 0) (1070 . 0) (1070 . 0) (1040 . 3.14159) (1040 . 0.0) (1040 . 0.0) (1040 . 1.0) (1040 . 1.0) (1040 . 0.0) (1040 . 0.0) (1070 . 0) (1002 . "{") (1003 . "SV-PNT-NUMB") (1003 . "SV-PNT-DESC") (1003 . "SV-PNT-ELEV") (1003 . "SV-PNT-MARK") (1003 . "SV-TRV-INST") (1002 . "}") (1002 . "}"))))

The last entries, with the 1003 code, are the frozen layers in the viewport I selected. The -3 code is the start of the XData.

Reply to
TomD

If it's not specified in the DXF list, it's BYLAYER otherwise it's specified with the same color code as any other entity in AutoCAD - code

  1. If it's zero, it's color is set to BYBLOCK. 256 also might show up which represents bylayer. Negative numbers indicate the layer is turned off.

Layers frozen in specific modelspace viewports are controlled via attached extended entity data attached to the viewport object which resides in paperspace for r14 and earlier versions of AutoCAD.

In AutoCAD 2000, 2000i, and 2002, this is stored in group code 341 of the viewport entity (in the main DXF list not in Xdata) and also is duplicated in the Xdata for compatibility reasons.

And if that isn't bad enough, in AutoCAD 2004, it's now stored in 331 instead of 341. 2004 also duplicates this data in xdata for compatibility reasons.

Due to the compatibility issues, unless your programming code is going to be running in multiple version of AutoCAD, it would be recommended to use the main DXF group codes instead of Xdata as the duplicate info in the Xdata may go away at some point.

Reply to
Darren J. Young

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.