
! script name: move.d/3dincmoveent
! 3dtopic: 3D move entity by incremental moves

!A
!A NAME:
!A
!A      3D Incremental Move Entity
!A
!A DESCRIPTION:
!A
!A 	This script allows a group of entities or a single entity to be
!A 	moved and the option of the original being deleted.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ELEMENT TO BE MOVED: Pick the element to be moved.
!B
!B	X,Y,Z AXIS INCREMENT: Value in X,Y,Z to shift entities.
!B
!# see also - points.d/xyzinput.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: 3d incremental move entity ")

DIM Answer$[256]
DIM Destination$[256]
DEG

Start: !
ActivateUndo

stat= SetInputFormat("n4","")
	
E1= PickEntity("PICK ELEMENT TO BE MOVED")
IF ExitScript(Destination$) THEN Leave
Stat=SetInputFormat("n4"," ")

Xmove=GetValue("X INCREMENT ")
IF ExitScript(Destination$) THEN Leave

Ymove=GetValue("Y INCREMENT ")
IF ExitScript(Destination$) THEN Leave

Zmove=GetValue("Z INCREMENT ")
IF ExitScript(Destination$) THEN Leave

Stat= EraseEntity(E1)

ActivateUndo
Stat= AdvanceUndoNumber("move")
Stat= AddItemToUndo(WsUBModifyMode,E1)

Pm=PointXYZ(Xmove,Ymove,Zmove)
T1=AngleTransform(Pm,0,0,0,WsWorkplaneVals)
Stat= TransEntityTrans(E1,T1,1)
Stat= PlotEntity(E1)


Stat= DeleteEntity(Pm)
Stat= DeleteEntity(Pt)
Stat= DeleteEntity(Pe)

GOTO Start

Leave: !
ActivateUndo
stat= SetInputFormat("n4","")
Stat= DeleteEntity(Pm)
Stat= DeleteEntity(Pt)
Stat= DeleteEntity(Pe)

IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
