请选择 进入手机版 | 继续访问电脑版

EDABOSS电子论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1100|回复: 6

[转帖] 将铜皮边框变为line源码分享

[复制链接]

47

主题

3

回帖

430

E币

技术员

Rank: 2

积分
97
发表于 2017-12-16 16:08:44 | 显示全部楼层 |阅读模式
  1. /****************************************************************/
  2. /*                 Command: ch_shape_to_line                    */
  3. /*                  Author: VivienLuo                           */
  4. /*           Creation Date: 2013-02-21                          */
  5. /*             Description: This Skill Function used to change  */
  6. /*                          the shape to line.                  */
  7. /****************************************************************/

  8. axlCmdRegister("ch_shape_to_line" 'ch_shape_to_line ?cmdType "interactive"
  9.                                  ?doneCmd 'shape2linedone ?cancelCmd 'shape2linecancel) ;registe command

  10. procedure(ch_shape_to_line()
  11. prog((selShape linePath lineLayer temp notdone )
  12.         shape2linepopup = axlUIPopupDefine(nil (list
  13.                                                 (list "Done" 'shape2linedone )
  14.                                                 (list "Cancel" 'shape2linecancel ))
  15.                                                 )
  16.         axlUIPopupSet(shape2linepopup)
  17.         notdone = t
  18.         axlUIWPrint(nil "------ Change Shape to Line V1.0 ---- Written By VivienLuo  ------")
  19.         axlUIWPrint(nil "------ E-mail : admin@allegro-skill.com ------ February 21, 2013 ------")
  20.         axlSetFindFilter(?enabled list("noall" "shapes") ?onButtons list("noall" "shapes"))
  21.         shape2lineMark = axlDBTransactionStart()

  22.         while(notdone
  23.                 axlClearSelSet()
  24.                 selShape = nil
  25.                 axlSingleSelectPoint()
  26.                 when(axlGetSelSet() != nil
  27.                 selShape = car(axlGetSelSet())
  28.                 linePath = axlPathStart(list(car(car(selShape->segments)->startEnd)))
  29.                 lineLayer = selShape->layer ;Gets Shape's Layer
  30.                 foreach(temp selShape->segments
  31.                                 case(temp->objType
  32.                                         ("line"
  33.                                                 axlPathLine(linePath nil cadr(temp->startEnd))
  34.                                                 )
  35.                                         ("arc"
  36.                                                 axlPathArcCenter(linePath nil cadr(temp->startEnd) temp->isClockwise temp->xy)
  37.                                                 )
  38.                                         (t
  39.                                                 printf("Path Type is Unknown!\n")
  40.                                                 )
  41.                                 );end case                        
  42.                 )        
  43.                 axlHighlightObject(car(axlDBCreatePath(linePath lineLayer 'line)))
  44.                 axlDeleteObject(selShape)
  45.                 axlUIWPrint(nil "- Change Shape To Line Success! -")
  46.                 );end when
  47.         );end while
  48. )
  49. );end procedure

  50. procedure(shape2linedone()
  51.                 notdone = nil
  52.                 axlDBTransactionCommit(shape2lineMark)
  53.                 axlFinishEnterFun()
  54.                 axlUIWPrint(nil "- Done -")
  55. )
  56. procedure(shape2linecancel()
  57.                 notdone = nil
  58.                 axlDBTransactionRollback(shape2lineMark)
  59.                 axlCancelEnterFun()
  60.                 axlUIWPrint(nil "- Cancel -")
  61. )
复制代码


积分规则
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|EDABOSS电子论坛

GMT+8, 2024-3-29 22:54 , Processed in 0.039275 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表