
! script name: move.d/3dincmovecont
! 3dtopic: 3D move group by incremental moves

!A
!A NAME:
!A
!A      3D Incremental Move Group
!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 GROUP TO BE MOVED: Pick an element on the group 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 group ")

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

Start: !
ActivateUndo

stat= SetInputFormat("n4","")

C1=PickGroupEnt("PICK GROUP TO BE MOVED ")
IF ExitScript(Destination$) THEN Leave

IF NOT ValidGeometry(C1) THEN Start
Stat=Highlight(C1,WsPickPen,WsDirArrowOff)

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(C1)

ActivateUndo
Stat= AdvanceUndoNumber("move")
Stat= AddGroupToUndo(WsUBModifyMode,C1,1,WsTrue)

Pm=PointXYZ(Xmove,Ymove,Zmove)
T1=AngleTransform(Pm,0,0,0,WsWorkplaneVals)
Stat=TransGroupTrans(C1,T1,0,1)
Stat= DeleteEntity(Pm)
Stat=PlotEntity(C1)

GOTO Start

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

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