将铜皮边框变为line源码分享
/****************************************************************//* 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 -")
) 我认为铜皮边框可以用z-copy的方式将其生成outline的边框,然后删除铜皮,最后打散outline到需要的line层,也可达到效果。 chuankay 发表于 2013-5-15 23:28 static/image/common/back.gif
我认为铜皮边框可以用z-copy的方式将其生成outline的边框,然后删除铜皮,最后打散outline到需要的line层, ...
呵呵,这样只是寻求一个快捷方式。 代码收藏了谢谢 chuankay 发表于 2013-5-15 23:37 static/image/common/back.gif
代码收藏了谢谢
这个还有更简便的方式。可使用axlPolyFromDB函数直接获取shape边框。。。 vivienluo 发表于 2013-5-15 23:40 static/image/common/back.gif
这个还有更简便的方式。可使用axlPolyFromDB函数直接获取shape边框。。。
看来您对database cteate那一篇很熟悉,我也要补习了 将铜皮变为line的功能,请问有哪些应用场景?outline一般都由结构给出的外形线来的,与铜皮有关系吗? 不知楼主有没有可以让铜皮与线之间互相转换的SKILL供大家学习,谢谢:(:) Shape菜单里的Decompose Shape命令就可以实现这个功能啊 chuchiwolong 发表于 2014-7-31 15:08
Shape菜单里的Decompose Shape命令就可以实现这个功能啊
Decompose Shape边的line在另外一层,二且是有一小段组成的。操作不方便。
页:
[1]
2