MKI_XPROPERTY (Entity Data Classes) Changed in Version 2023.0 |
www.CAD6.com |
C++ Syntaxclass MKI_XPROPERTY { public:
__int32 m_nFlag, m_nPen, m_nFillMode; MKI_COLORVALUE m_cFillColor, m_cLineColor; __int32 m_nLineType; double m_dLineWidth; __int32 m_nLineMode, m_nLayer, m_nPage; MKI_COLORMODEL m_cFillColorMode; MKI_ALPHAVALUE m_cFillAlpha; MKI_COLORMODEL m_cLineColorMode; MKI_ALPHAVALUE m_cLineAlpha; double m_dLineTypeScale;
__int32 m_nFromPen, m_nFromLayer;
void Init( void );
void MKI_CONST_PROPERTY_REF f_rSource );
void MKI_CONST_PROPERTY_REF f_rSource, const __int32 f_nFlag );
void MKI_PROPERTY_REF f_rDestin, const __int32 f_nFlag ) const;
void const MKI_XPROPERTY& f_rSource, const __int32 f_nFlag );
void const MKI_XPROPERTY& f_rSource );
void ResolveLayerPen( void );
bool bool f_fIgnorePage ); New in Version 2023.0
bool const MKI_XPROPERTY& f_rXProperty ) const;
bool const MKI_XPROPERTY& f_rXProperty ) const;
void __int32 f_nPenDefault, __int32 f_nLayerDefault );
bool IsFilled( void ) const;
bool IsErased( void ) const;
bool IsOpaque( void ) const;
bool IsFramed( void ) const;
bool IsVisible( void ) const;
bool IsPrinted( void ) const;
bool IsLocked( void ) const;
bool IsSnapped( void ) const;
bool IsGrayed( void ) const; };
This structure contains an extended property set.
Element Descriptionm_nFlag [__int32] In entities of type "Instance" or "Block", the transmission flags indicate whether to transmit a specific property or not. This is stored in the value m_fFlag, which is a bit-wise OR combination of one or more values (see MKI_USE_*). The value MKI_USE_PEN has the lowest priority, the value MKI_USE_LAYER has the highest priority. Assuming that both a pen index (and consequently the pen's line width) and an explicit line width are transmitted, the explicit line width (transmitted by setting the MKI_USE_LINEWIDTH flag) has a higher priority than the transmitted pen's line width (transmitted by setting the MKI_USE_PEN flag). In entities of type "Object", the transmission flags indicate whether to accept the transmission or not. This is stored in the value m_nFlag, which is a bit-wise OR combination of one or more of the same values as stated above. If one of these flags is set, the transmission of the corresponding layer / pen property will not be accepted, i.e. this object property is fixed. m_nPen [__int32] Index of the pen. Valid range: 0 <= Value <= MKI_PEN_MAX. m_nFillMode [__int32] The value m_nFillMode determines, which parts of an object are to be drawn (see MKI_FILLMODE_*). m_cFillColor Changed in Version 6.60 [MKI_COLORVALUE] Color of the object's surface in the notation defined by m_cFillColorMode. m_cLineColor Changed in Version 6.60 [MKI_COLORVALUE] Color of the object's outline in the notation defined by m_cLineColorMode. m_nLineType Changed in Version 2014.2 [__int32] Index of the line type used to draw the outline. Valid range: 0 <= Value <= MKI_LINE_MAX. Another special allowed value is MKI_LINE_BYLAYER (9999) which is interpreted as "by layer", i.e. the line type will be defined by the corresponding layer. m_dLineWidth Changed in Version 2014.2 [double] Width of the object's outline in [mm] between 0.0 and MKI_LINEWIDTH_MAX (including). A width of 0.0 always results in a line of the minimum width possible on the respective device (one pixel). Any negative value is interpreted as "by layer", i.e. the line width will be defined by the corresponding layer (use MKI_LINEWIDTH_BYLAYER). m_nLineMode Changed in Version 2013.2 [__int32] Various line handling modes (see MKI_LINEMODE_*). m_nLayer [__int32] Index of the layer. Valid range: 0 <= Value <= MKI_LAYER_MAX. m_nPage New in Version 6.50 [__int32] Index of the page to which this entity is assigned (-1 for "Model Space"). Valid range: -1 <= Value < MKI_PAGE_MAX. m_cFillColorMode Changed in Version 2014.2 [MKI_COLORMODEL] Determines how the content of m_cFillColor is to be interpreted (see MKI_COLORMODE_*). m_cFillAlpha Changed in Version 2014.2 [MKI_ALPHAVALUE] Determines the translucency of the object's surface. m_cLineColorMode Changed in Version 2014.2 [MKI_COLORMODEL] Determines how the content of m_cLineColor is to be interpreted (see MKI_COLORMODE_*). m_cLineAlpha Changed in Version 2014.2 [MKI_ALPHAVALUE] Determines the translucency of the object's outline. m_dLineTypeScale New in Version 2012.1 [double] Scaling factor for line type display. The lengths of all partial lines and gaps will be multiplied by this factor. Valid range: 1e-10 <= Value <= 1e10. m_nFromPen New in Version 2020.0 [__int32] Indication which elements of this structure were transmitted by the pen. A bit-wise OR combination of one or more values (see MKI_USE_*), is not guaranteed to be initialized in all situations, otherwise 0. This value must not be modified! m_nFromLayer New in Version 2020.0 [__int32] Indication which elements of this structure were transmitted by the layer. A bit-wise OR combination of one or more values (see MKI_USE_*), is not guaranteed to be initialized in all situations, otherwise 0. This value must not be modified!
MKD SyntaxThe data type MKI_XPROPERTY is used to store the extended properties of an object.
As described in the chapter MKI_PROPERTY (Properties), the display of each object is determined by a set of five properties. This "direct" assignment of properties is only suitable for simple, independent objects.
If objects are combined to blocks (see Entity "Block") problems occur. Each separate object inside the block may have for example a different outline color. If such a block is referenced multiple times, all references will use the same outline color for all corresponding objects. Now imagine you want to set the outline color of just one referenced block to red, without modifying the other references.
The solution is provided by a transmission process. Each instance (i.e. reference) of a block contains its own extended set of properties, plus the information which of these properties shall be transmitted to the referenced block's objects. If the instance contains the information "transmit the outline color red to all objects", all objects of this instance will be drawn with red outlines - without any change in the block's definition. All other instances will still be drawn in their object's original outline colors.
Such a transmission is valid for all subordinate objects and instances, i.e. usually all objects of an instance will be modified by transmission. Now imagine a block consisting of several objects, some of which have to maintain a specific property, some not. For example, some objects have to be only outlined (as they are lines), some may either be outlined or filled, depending on the intended use of that block. To achieve this difference, objects themselves have to contain transmission information - saying that they do not want to receive a special transmitted property, i.e. that this special object property is fixed. In the preceding example, the transmission information for those objects that should always be outlined would be "I do not accept the transmission of a filling mode because this property is fixed".
Both types of transmission information are similar, as for each single property there is one flag saying either "transmit" or "do not accept transmission" (or in other words: "fix property"). As a result, the data type used to store the properties and the transmission information is equal for objects, instances, and blocks, only the interpretation is different.
In entities of type "Instance" or "Block", the transmission flags indicate whether to transmit a specific property or not. In entities of type "Object", they indicate whether to accept the transmission or not, i.e. whether to fix a specific property or not.
To store the properties and the transmission information the following structure is used. For further description of the transmission process itself, see the reference of the application.
Flag,Pen,FillMode,FillColor,LineColor,LineWidth,LineType,LineMode, Layer,Page,FillAlpha,LineAlpha,LineTypeScale
Examples0,0,2,0/0/0/1,0/0/0/0,0.5,1,0,0,-1,0,0,1.0
An object with this property set is assigned to layer 0 (layer 0 transmits no properties, see MKI_LAYERDEF.) and it uses pen 0 (pen 0 transmits no properties, see MKI_PENDEF). There are no fixed properties. Because layer and pen are equal to 0 the object is drawn with its own properties: a blue filling and a 0.5 mm wide black line using line type 1.
8,1,2,0/0/0/1,0/0/0/0,0.5,0,0,100,1,0,0,1.0
An object with this property set is assigned to layer 100 and it uses pen 1. Its line color is fixed. So how this object is drawn also depends on the transmitted properties of layer 100 and pen 1. However a fixed property is always drawn no matter whether the corresponding layer or pen property is transmitted. A transmitted layer property has a higher priority (see MKI_LAYERDEF) then a transmitted pen property. Because pen properties have the lowest priority (see MKI_PENDEF) a pen property is drawn only if the corresponding layer and object property is not transmitted and not fixed respectively. The object is assigned to page 2 (index 1), i.e. it will only be visible if page 2 is visible.
|
CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH