Skip to content
On this page

[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

Table of contents

Constructors

Methods

Constructors

constructor

new MxCADUiPrBase(imp)

Constructor function

Parameters

NameTypeDescription
ImpanyInternal implementation object

Methods

abort

abort(cause?): void

Stop the current dynamic drag

Parameters

NameTypeDefault value
causeDetailedResultDetailedResult.kCodeAbort

Returns

void

void


clearLastInputPoint

clearLastInputPoint(): void

Clear the previous input point data.

Returns

void

Example

ts
//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();

disableAllTrace

disableAllTrace(isDisable?): void

Disable all tracking

Parameters

NameTypeDefault valueDescription
IsDisablebooleantrueIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.disableAllTrace(true);

drawReserve

drawReserve(callAddEntity?): void

Keep the dynamically drawn objects on the graph.

Parameters

NameTypeDescription
callAddEntity?(ent: Objecti3D)=>voidcallback parameter ent type: THREE.THREE.Object3D

Returns

void

Example

ts
//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()

getCursorType

getCursorType(): MxCursorType

Return cursor type

Returns

MxCursorType

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.getCursorType())

getDetailedResult

getDetailedResult(): DetailedResult

Return detailed reasons for interactive operation exit

Returns

DetailedResult

The return value type of the current interactive operation

Example

ts
//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)
   }

getDynamicInputType

getDynamicInputType(): DynamicInputType

Return dynamic input type

Returns

DynamicInputType

Dynamic input display type

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.getDynamicInputType())

getInputToucheType

getInputToucheType(): number

Return the required Touche input type

Returns

number

Touche input type

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint();
  const toucheType = getPoint.getInputToucheType();
  console.log(toucheType)

getStatus

getStatus(): MrxDbgUiPrBaseReturn

Get operation status

Returns

MrxDbgUiPrBaseReturn

Operation status value

Example

ts
//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
 }

isDisableDynInput

isDisableDynInput(): boolean

Do you want to disable dynamic input boxes

Returns

boolean

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.isDisableDynInput())

isDisableDynamicTrace

isDisableDynamicTrace(): boolean

Do you want to disable dynamic tracking

Returns

boolean

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.isDisableDynamicTrace())

isDisableGridTrace

isDisableGridTrace(): boolean

Do you want to disable grid tracking

Returns

boolean

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.isDisableGridTrace())

isDisableOrthoTrace

isDisableOrthoTrace(): boolean

Do you want to disable ortho tracing

Returns

boolean

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.isDisableOrthoTrace())

isDisableOsnap

isDisableOsnap(): boolean

Do you want to disable capture

Returns

boolean

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.isDisableOsnap())

isDisablePolarAxisTrace

isDisablePolarAxisTrace(): boolean

Do you want to disable polar tracking

Returns

boolean

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  console.log(getPoint.isDisablePolarAxisTrace())

isKeyWordPicked

isKeyWordPicked(matchKeyWord): boolean

Test whether a certain keyword is selected by the user

Parameters

NameTypeDescription
MatchKeyWordstringKeywords to be detected

Returns

boolean

True is true

Example

ts
//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)
  }

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

Returns

string

Selected keywords

Example

ts
//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)

keyWords

keyWords(): string

Return keyword list

Returns

string

Keyword List

Example

ts
//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)]

message

message(): string

Prompt string

Returns

string

Reminder message

Example

ts
//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 information

setCursorType

setCursorType(type): void

Set cursor type

Parameters

NameTypeDescription
TypeMxCursorTypeMouse Style Type

Returns

void

Example

ts
//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();

setDisableDynInput

setDisableDynInput(isDisable): void

Set whether to disable dynamic input boxes

Parameters

NameTypeDescription
IsDisablebooleanIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDisableDynInput(true);

setDisableDynamicTrace

setDisableDynamicTrace(isDisable): void

Set whether to disable dynamic tracking

Parameters

NameTypeDescription
IsDisablebooleanIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDisableDynamicTrace(true);

setDisableGridTrace

setDisableGridTrace(isDisable): void

Set whether to disable grid tracking

Parameters

NameTypeDescription
IsDisablebooleanIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDisableGridTrace(true);

setDisableOrthoTrace

setDisableOrthoTrace(isDisable): void

Set whether to disable orthotracing

Parameters

NameTypeDescription
IsDisablebooleanIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDisableOrthoTrace(true);

setDisableOsnap

setDisableOsnap(isDisable): void

Set whether to disable capture

Parameters

NameTypeDescription
IsDisablebooleanIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDisableOsnap(true);

setDisablePolarAxisTrace

setDisablePolarAxisTrace(isDisable): void

Set whether to disable polar tracking

Parameters

NameTypeDescription
IsDisablebooleanIs it disabled

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDisablePolarAxisTrace(true);

setDynamicInputType

setDynamicInputType(type): void

Set dynamic input type

Parameters

NameTypeDescription
TypeDynamicInputTypeDynamic Input Display Type

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';
  import { DynamicInputType } from "mxdraw";

  const getPoint = new MxCADUiPrPoint()
  getPoint.setDynamicInputType(DynamicInputType.kXYCoordInput);

setInputToucheType

setInputToucheType(toucheType): void

Set the required Touche input type, default value is MxType InputToucheType.kGetBegan

Parameters

NameTypeDescription
ToucheTypeNumberToucheType Type

Returns

void

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad';

  const getPoint = new MxCADUiPrPoint();
  getPoint.setInputToucheType(MxType.InputToucheType.kGetEnd);

setKeyWords

setKeyWords(keyWordList): void

Set keyword list

Parameters

NameTypeDescription
KeyWordListstringKeyword List

Returns

void

void

Example

ts
//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)]")

setLastInputPoint

setLastInputPoint(pt): void

Set the previous input point.

Parameters

NameTypeDescription
PtMcGePoint3d (2d. McGePoint3d. md)Point Object

Returns

void

Example

ts
//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));

setMessage

setMessage(message): void

Set prompt string

Parameters

NameTypeDescription
messagestringprompt message

Returns

void

Reminder message

Example

ts
//Example of MxCADUiPrPoint class
  import { MxCADUiPrPoint } from 'mxcad'

  const getPoint = new MxCADUiPrPoint();
GetPoint.setMessage ("prompt message")

setOffsetInputPostion

setOffsetInputPostion(isOffset): void

Set the input point to move a distance

Parameters

NameType
isOffsetboolean

Returns

void


setUserDraw

setUserDraw(pDraw): void

Set the dynamic drawing calling object for the interaction process

Parameters

NameTypeDescription
PDraw(CurrentPoint: [McGePoint3d] (2d. McGePoint3d. md), pWorldDraw: McEdGetPointWorldDrawObject)=>voidMcEdGetPointWorldDrawObject \

Returns

void

void

Example

ts
//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();

setUserInputControls

setUserInputControls(contros): void

Set input control settings

Parameters

NameType
controsnumber

Returns

void

Example

ts
//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;

userInputControls

userInputControls(): number

Return to input control settings

Returns

number

Example

ts
//Example of MxCADUiPrInt class
  import { MxCADUiPrInt } from 'mxcad';

  let getInt = new MxCADUiPrInt();
  console.log(getInt.userInputControls())