|
- /****************************************************************/
- /* Command: ch_shape_to_line */
- /* Author: VivienLuo */
- /* Email: admin@allegro-skill.com */
- /* Creation Date: 2013-02-21 */
- /* Description: This Skill Function used to change */
- /* the shape to line. */
- /****************************************************************/
- axlCmdRegister("ch_shape_to_line" 'ch_shape_to_line ?cmdType "interactive"
- ?doneCmd 'shape2linedone ?cancelCmd 'shape2linecancel) ;registe command
- procedure(ch_shape_to_line()
- prog((selShape linePath lineLayer temp notdone )
- shape2linepopup = axlUIPopupDefine(nil (list
- (list "Done" 'shape2linedone )
- (list "Cancel" 'shape2linecancel ))
- )
- axlUIPopupSet(shape2linepopup)
- notdone = t
- axlUIWPrint(nil "------ Change Shape to Line V1.0 ---- Written By VivienLuo ------")
- axlUIWPrint(nil "------ E-mail : admin@allegro-skill.com ------ February 21, 2013 ------")
- axlSetFindFilter(?enabled list("noall" "shapes") ?onButtons list("noall" "shapes"))
- shape2lineMark = axlDBTransactionStart()
-
- while(notdone
- axlClearSelSet()
- selShape = nil
- axlSingleSelectPoint()
- when(axlGetSelSet() != nil
- selShape = car(axlGetSelSet())
- linePath = axlPathStart(list(car(car(selShape->segments)->startEnd)))
- lineLayer = selShape->layer ;Gets Shape's Layer
- foreach(temp selShape->segments
- case(temp->objType
- ("line"
- axlPathLine(linePath nil cadr(temp->startEnd))
- )
- ("arc"
- axlPathArcCenter(linePath nil cadr(temp->startEnd) temp->isClockwise temp->xy)
- )
- (t
- printf("Path Type is Unknown!\n")
- )
- );end case
- )
- axlHighlightObject(car(axlDBCreatePath(linePath lineLayer 'line)))
- axlDeleteObject(selShape)
- axlUIWPrint(nil "- Change Shape To Line Success! -")
- );end when
- );end while
- )
- );end procedure
- procedure(shape2linedone()
- notdone = nil
- axlDBTransactionCommit(shape2lineMark)
- axlFinishEnterFun()
- axlUIWPrint(nil "- Done -")
- )
- procedure(shape2linecancel()
- notdone = nil
- axlDBTransactionRollback(shape2lineMark)
- axlCancelEnterFun()
- axlUIWPrint(nil "- Cancel -")
- )
复制代码 |
|