[mxcad_2d API documentation] (../README. md)/[2d] (../modules/2d. md)/McRxObject
Class: McRxObject
2d.McRxObject
Represents the base class of an Rx object.
Hierarchy
McRxObject
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new McRxObject(imp?
)
Constructor.
Example
import { McRxObject } from "mxcad"
let obj = new McRxObject();
Parameters
Name | Type | Description |
---|---|---|
imp? | Any | Internal implementation object |
Properties
imp
• imp: any
= 0
Internal implementation object.
Accessors
dxf0
• get
dxf0(): string
Obtain the type name of the object's DXF group code, which is the same as the DXF group code in AutoCAD. For example, the type name of the line is McDbLine, and the group code value for DXF0 is: LINE and DXF0 group code values can be used for type filtering when constructing sets.
Returns
string
objectName
• get
objectName(): string
Get the object name.
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
console.log(obj.objectName);
Returns
string
Return object name
Methods
getImp
▸ getImp(): any
Retrieve internal implementation objects.
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
let imp = obj.getImp();
Returns
any
Internal implementation object.
getJson
▸ getJson(): string
Retrieve a string in JSON format.
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
const json = obj.getJson()
Returns
string
A string in JSON format.
initTempObject
▸ initTempObject(imp
): void
Initialize temporary objects.
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
obj.initTempObject()
Parameters
Name | Type | Description |
---|---|---|
'imp' | 'any' | Internal implementation object |
Returns
void
isKindOf
▸ isKindOf(sObjectName
): boolean
Determine object type
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
let isKind = obj.isKindOf('SomeObjectType');
console.log(isKind); // Output: True or false
Parameters
Name | Type | Description |
---|---|---|
SOrtName | string | Type Name |
Returns
boolean
Return whether the object is of the target type
isNull
▸ isNull(): any
Determine if it is an empty object
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
console.log(obj.isNull()); // Output: True or false
Returns
any
setJson
▸ setJson(str
): boolean
Set a string in JSON format.
Example
import { McRxObject } from 'mxcad';
let obj = new McRxObject();
const res = obj.setJson('{"key": "value"}');
console.log(res)
Parameters
Name | Type | Description |
---|---|---|
Str | string | JSON formatted string |
Returns
boolean
Is the setting successful.