ade_dwggetsetting

Land Desktop Development ARX CPP SDK

Up a level
ade_dwggetsetting
 
 

Gets a drawing setting value.

struct resbuf*

ade_dwggetsetting(

ade_id dwg_id,

char* setting);

Returns the value of the given drawing setting or NULL.

dwg_id Drawing ID.
setting The drawing setting name. See Drawing Setting Names below
Drawing Setting Names
Setting Name Return Value
dwgname Drawing name; a path alias and file name, such as "myfiles:\\mydwg.dwg
dwgdesc Drawing description.
t_scale Simple transform scale.
For example, 1.2 = 120%
t_rotate Simple transform rotation direction. Value depends on the AutoCAD ANGDIR setting (real). Values:
0 = counterclockwise
1 = clockwise
t_xoffset Simple transform X offset.
t_yoffset Simple transform Y offset.
t_apply Flag value. Values:
1 = apply all simple transformations defined for the given drawing
0 = do not apply transformations
saveback Save back coordinates, a sequence of corner points, in this order: lower left, lower right, upper right, upper left, separated by "."

The following sample gets the drawing ID from an attached drawing using ade_dwggetid() then parses the resbuf returned by ade_dwggetsetting() and prints the information relevant to the setting specified. Then it releases the resbuf, as required.

ade_id dwgId;
char* pszDwgPathName = "MYDWGS:\\994049-2blk.dwg";
dwgId = ade_dwggetid (pszDwgPathName);

struct resbuf* pDwgSettingRb;
char* pszDwgSetting = "dwgdesc";
pDwgSettingRb = ade_dwggetsetting(dwgId, pszDwgSetting);
while(pDwgSettingRb != NULL) {
    acutPrintf(
        "\nThe %s information associated with attached drawing %s is: %s"
        ,pszDwgSetting, pszDwgPathName, pDwgSettingRb->resval.rstring);
    pDwgSettingRb = pDwgSettingRb->rbnext;
}
acutRelRb(pDwgSettingRb);