[mxcad_2d API documentation] (../README. md)/[2d] (../modules/2d. md)/MxCADUiPrBase
Class: MxCADUiPrBase
2d.MxCADUiPrBase
As the base class of the MxCADUiPr * series, MxCADUiPrBase provides some basic functionalities.
Hierarchy
MxCADUiPrBase
Table of contents
Constructors
Methods
- abort
- clearLastInputPoint
- disableAllTrace
- drawReserve
- getCursorType
- getDetailedResult
- getDynamicInputType
- getInputToucheType
- getStatus
- isDisableDynInput
- isDisableDynamicTrace
- isDisableGridTrace
- isDisableOrthoTrace
- isDisableOsnap
- isDisablePolarAxisTrace
- isKeyWordPicked
- isOffsetInputPostion
- keyWordPicked
- keyWords
- message
- setCursorType
- setDisableDynInput
- setDisableDynamicTrace
- setDisableGridTrace
- setDisableOrthoTrace
- setDisableOsnap
- setDisablePolarAxisTrace
- setDynamicInputType
- setInputToucheType
- setKeyWords
- setLastInputPoint
- setMessage
- setOffsetInputPostion
- setUserDraw
- setUserInputControls
- userInputControls
Constructors
constructor
• new MxCADUiPrBase(imp)
Constructor function
Parameters
| Name | Type | Description |
|---|---|---|
| Imp | any | Internal implementation object |
Methods
abort
▸ abort(cause?): void
Stop the current dynamic drag
Parameters
| Name | Type | Default value |
|---|---|---|
cause | DetailedResult | DetailedResult.kCodeAbort |
Returns
void
void
clearLastInputPoint
▸ clearLastInputPoint(): void
Clear the previous input point data.
Example
//Taking the MxCADUiPrPoint class as an example, the same applies to other classes in the MxCADUiPr * series
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
getPoint.clearLastInputPoint();Returns
void
disableAllTrace
▸ disableAllTrace(isDisable?): void
Disable all tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.disableAllTrace(true);Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| IsDisable | boolean | true | Is it disabled |
Returns
void
drawReserve
▸ drawReserve(callAddEntity?): void
Keep the dynamically drawn objects on the graph.
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint();
const basePt = new McGePoint3d(0, 0, 0);
getPoint.setBasePt(basePt);
getPoint.setUserDraw((pt,pw)=>{
const line = new McDbLine(basePt, pt);
pw.drawMcDbEntity(line)
})
const val = await getPoint.go();
if (!val) return;
getPoint.drawReserve()Parameters
| Name | Type | Description |
|---|---|---|
callAddEntity? | (ent: Objecti3D)=>void | callback parameter ent type: THREE.THREE.Object3D |
Returns
void
getCursorType
▸ getCursorType(): MxCursorType
Return cursor type
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.getCursorType())Returns
MxCursorType
getDetailedResult
▸ getDetailedResult(): DetailedResult
Return detailed reasons for interactive operation exit
Example
//Example of MxCADUiPrList class
import { MxCADUiPrDist } from 'mxcad';
import { DetailedResult } from "mxdraw";
const getDist = new MxCADUiPrDist();
const val = await getDist.go();
if (!val) return;
if (getDist.getDetailedResult() === DetailedResult.kCoordIn) {
Console.log ('prompt input', val)
}Returns
DetailedResult
The return value type of the current interactive operation
getDynamicInputType
▸ getDynamicInputType(): DynamicInputType
Return dynamic input type
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.getDynamicInputType())Returns
DynamicInputType
Dynamic input display type
getInputToucheType
▸ getInputToucheType(): number
Return the required Touche input type
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint();
const toucheType = getPoint.getInputToucheType();
console.log(toucheType)Returns
number
Touche input type
getStatus
▸ getStatus(): MrxDbgUiPrBaseReturn
Get operation status
Example
//Example of MxCADUiPrList class
import { MxCADUiPrDist } from 'mxcad';
import { MrxDbgUiPrBaseReturn } from "mxdraw";
const getDist = new MxCADUiPrDist();
const val = await getDist.go();
if (!val) return;
if(getPoint.getStatus() === MrxDbgUiPrBaseReturn.kNone) {
//Empty input
}Returns
MrxDbgUiPrBaseReturn
Operation status value
isDisableDynInput
▸ isDisableDynInput(): boolean
Do you want to disable dynamic input boxes
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableDynInput())Returns
boolean
isDisableDynamicTrace
▸ isDisableDynamicTrace(): boolean
Do you want to disable dynamic tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableDynamicTrace())Returns
boolean
isDisableGridTrace
▸ isDisableGridTrace(): boolean
Do you want to disable grid tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableGridTrace())Returns
boolean
isDisableOrthoTrace
▸ isDisableOrthoTrace(): boolean
Do you want to disable ortho tracing
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableOrthoTrace())Returns
boolean
isDisableOsnap
▸ isDisableOsnap(): boolean
Do you want to disable capture
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableOsnap())Returns
boolean
isDisablePolarAxisTrace
▸ isDisablePolarAxisTrace(): boolean
Do you want to disable polar tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisablePolarAxisTrace())Returns
boolean
isKeyWordPicked
▸ isKeyWordPicked(matchKeyWord): boolean
Test whether a certain keyword is selected by the user
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint();
GetPoint. setKeyWords ("[Option 1 (A)/Option 2 (B)]");
const pt = await getPoint.go();
if(getPoint.isKeyWordPicked('A')){
Console.log (Option 1)
}else if(getPoint.isKeyWordPicked('B')){
Console.log (Option 2)
}Parameters
| Name | Type | Description |
|---|---|---|
| MatchKeyWord | string | Keywords to be detected |
Returns
boolean
True is true
isOffsetInputPostion
▸ isOffsetInputPostion(): boolean
Do you want to input a point to move a distance
Returns
boolean
keyWordPicked
▸ keyWordPicked(): string
Return the keywords selected by the user
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint();
GetPoint. setKeyWords ("[Option 1 (A)/Option 2 (B)]");
const pt = await getPoint.go();
const key = getPoint.keyWordPicked();
console.log(key)Returns
string
Selected keywords
keyWords
▸ keyWords(): string
Return keyword list
Example
//Taking the MxCADUiPrPoint class as an example, the same applies to other classes in the MxCADUiPr * series
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
GetPoint. setKeyWords ("[Option 1 (A)/Option 2 (B)]");
const keyList = getPoint.keyWords();
Console.log ("Keyword List", keyList)//Keyword List [Option 1 (A)/Option 2 (B)]Returns
string
Keyword List
message
▸ message(): string
Prompt string
Example
//Taking the MxCADUiPrPoint class as an example, the same applies to other classes in the MxCADUiPr * series
import { MxCADUiPrPoint , McGePoint3d} from 'mxcad'
const getPoint = new MxCADUiPrPoint();
GetPoint.setMessage ("Test Message");
console.log(getPoint.message());// Test informationReturns
string
Reminder message
setCursorType
▸ setCursorType(type): void
Set cursor type
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
import { MxCursorType } from "mxdraw";
const getPoint = new MxCADUiPrPoint()
GetPoint.setMessage ("Specify text starting point: ")
getPoint.setCursorType(MxCursorType.kCross);
const pt = await getPoint.go();Parameters
| Name | Type | Description |
|---|---|---|
| Type | MxCursorType | Mouse Style Type |
Returns
void
setDisableDynInput
▸ setDisableDynInput(isDisable): void
Set whether to disable dynamic input boxes
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableDynInput(true);Parameters
| Name | Type | Description |
|---|---|---|
| IsDisable | boolean | Is it disabled |
Returns
void
setDisableDynamicTrace
▸ setDisableDynamicTrace(isDisable): void
Set whether to disable dynamic tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableDynamicTrace(true);Parameters
| Name | Type | Description |
|---|---|---|
| IsDisable | boolean | Is it disabled |
Returns
void
setDisableGridTrace
▸ setDisableGridTrace(isDisable): void
Set whether to disable grid tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableGridTrace(true);Parameters
| Name | Type | Description |
|---|---|---|
| IsDisable | boolean | Is it disabled |
Returns
void
setDisableOrthoTrace
▸ setDisableOrthoTrace(isDisable): void
Set whether to disable orthotracing
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableOrthoTrace(true);Parameters
| Name | Type | Description |
|---|---|---|
| IsDisable | boolean | Is it disabled |
Returns
void
setDisableOsnap
▸ setDisableOsnap(isDisable): void
Set whether to disable capture
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableOsnap(true);Parameters
| Name | Type | Description |
|---|---|---|
| IsDisable | boolean | Is it disabled |
Returns
void
setDisablePolarAxisTrace
▸ setDisablePolarAxisTrace(isDisable): void
Set whether to disable polar tracking
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint()
getPoint.setDisablePolarAxisTrace(true);Parameters
| Name | Type | Description |
|---|---|---|
| IsDisable | boolean | Is it disabled |
Returns
void
setDynamicInputType
▸ setDynamicInputType(type): void
Set dynamic input type
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
import { DynamicInputType } from "mxdraw";
const getPoint = new MxCADUiPrPoint()
getPoint.setDynamicInputType(DynamicInputType.kXYCoordInput);Parameters
| Name | Type | Description |
|---|---|---|
| Type | DynamicInputType | Dynamic Input Display Type |
Returns
void
setInputToucheType
▸ setInputToucheType(toucheType): void
Set the required Touche input type, default value is MxType InputToucheType.kGetBegan
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint();
getPoint.setInputToucheType(MxType.InputToucheType.kGetEnd);Parameters
| Name | Type | Description |
|---|---|---|
| ToucheType | Number | ToucheType Type |
Returns
void
setKeyWords
▸ setKeyWords(keyWordList): void
Set keyword list
Example
//Taking the MxCADUiPrPoint class as an example, the same applies to other classes in the MxCADUiPr * series
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
GetPoint. setKeyWords ("[Option 1 (A)/Option 2 (B)]")Parameters
| Name | Type | Description |
|---|---|---|
| KeyWordList | string | Keyword List |
Returns
void
void
setLastInputPoint
▸ setLastInputPoint(pt): void
Set the previous input point.
Example
//Taking the MxCADUiPrPoint class as an example, the same applies to other classes in the MxCADUiPr * series
import { MxCADUiPrPoint , McGePoint3d} from 'mxcad'
const getPoint = new MxCADUiPrPoint();
getPoint.setLastInputPoint(new McGePoint3d(0,0,0));Parameters
| Name | Type | Description |
|---|---|---|
| Pt | McGePoint3d (2d. McGePoint3d. md) | Point Object |
Returns
void
setMessage
▸ setMessage(message): void
Set prompt string
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
GetPoint.setMessage ("prompt message")Parameters
| Name | Type | Description |
|---|---|---|
message | string | prompt message |
Returns
void
Reminder message
setOffsetInputPostion
▸ setOffsetInputPostion(isOffset): void
Set the input point to move a distance
Parameters
| Name | Type |
|---|---|
isOffset | boolean |
Returns
void
setUserDraw
▸ setUserDraw(pDraw): void
Set the dynamic drawing calling object for the interaction process
Example
//Example of MxCADUiPrPoint class
import { MxCADUiPrPoint } from 'mxcad';
const getPoint = new MxCADUiPrPoint();
getPoint.setUserDraw((pt,pw)=>{
console.log(pt, pw)
})
const pt = await getPoint.go();Parameters
| Name | Type | Description |
|---|---|---|
| PDraw | (CurrentPoint: [McGePoint3d] (2d. McGePoint3d. md), pWorldDraw: McEdGetPointWorldDrawObject)=>void | McEdGetPointWorldDrawObject \ |
Returns
void
void
setUserInputControls
▸ setUserInputControls(contros): void
Set input control settings
Example
//Example of MxCADUiPrInt class
import { MxCADUiPrInt } from 'mxcad';
import { UserInputControls } from "mxdraw"
let getInt = new MxCADUiPrInt();
GetInt.setMessage ("Enter integer: ");
getInt.setUserInputControls(UserInputControls.kNoZeroResponseAccepted);
let iRowNum = await getInt.go();
if (iRowNum == null) return;Parameters
| Name | Type |
|---|---|
contros | number |
Returns
void
userInputControls
▸ userInputControls(): number
Return to input control settings
Example
//Example of MxCADUiPrInt class
import { MxCADUiPrInt } from 'mxcad';
let getInt = new MxCADUiPrInt();
console.log(getInt.userInputControls())Returns
number
