找回密码
 注册
关于网站域名变更的通知
楼主: deargds
打印 上一主题 下一主题

[原创SKILL]复位REFDES到零件中心及自动旋转文字。

    [复制链接]

该用户从未签到

181#
发表于 2010-12-8 21:06 | 只看该作者
回复 deargds 的帖子

移动ref到元件中心 这个命令在allegro里可以用,但是在apd 和sip中不还使,错误提示是can‘t find place_bound!
在网上找到一个叫mcenter的skill,他在allegro、apd、sip都能正确执行,可以把移动旋转用一个命令完成,且修正了因为文字的对其方式不同造成的偏差问题。
下面是人家的原代码(好东西是要共享的):
; Ref Place To Symbole Center and AotoRotate
; Author: Langexie
; Version: 1.00
; Date: 2010/06/07

axlCmdRegister("mcenter" 'move_ref_center)
procedure( move_ref_center()

popup = axlUIPopupDefine(nil list(list("Done" `axlFinishEnterFun)))
axlUIPopupSet(popup)

axlClearSelSet()

axlSetFindFilter( ?enabled  list( "noall" "text")  ?onButtons  list( "noall" "text"))

(while (axlSelect)
  alltexts = axlGetSelSet()
  axlClearSelSet()
  foreach(texts alltexts
    sym = texts -> parent
    when( sym

      when( and(texts -> text == sym -> component -> name)
         comps_bbox = axlDBAltOrigin('center sym)
         comps_center_x = xCoord(comps_bbox)
         comps_center_y = yCoord(comps_bbox)
         comps_angle = sym -> rotation     
         text_angle_a = texts -> rotation
         r_angle = comps_angle - text_angle_a

    axlTransformObject(texts , ?angle  r_angle)
        text_angle_b = texts -> rotation
    when(90<=text_angle_b && text_angle_b<270
        axlTransformObject(texts , ?angle  180)
        )                         
        text_angle_c = texts -> rotation
        text_center_bbox = axlDBAltOrigin('center texts)
        excursion = axlGetParam(strcat("paramTextBlock:" texts->textBlock))->height            

        when(0<text_angle_c && text_angle_c<90
          text_center_x = xCoord(text_center_bbox)       
          text_center_y = yCoord(text_center_bbox)
          text_angle_d = text_angle_c
          m_x = comps_center_x - text_center_x + 0.15 * excursion * sin(3.14159/180 * text_angle_d)
          m_y = comps_center_y - text_center_y - 0.15 * excursion* cos(3.14159/180 * text_angle_d)
        )
        when(270<=text_angle_c && text_angle_c<360 || text_angle_c == 0
          text_center_x = xCoord(text_center_bbox)       
          text_center_y = yCoord(text_center_bbox)
          text_angle_d = 360 - text_angle_c
          m_x = comps_center_x - text_center_x - 0.15 * excursion * sin(3.14159/180 * text_angle_d)
          m_y = comps_center_y - text_center_y - 0.15 * excursion * cos(3.14159/180 * text_angle_d)                       
         )
        axlTransformObject(texts , ?move list(m_x ,m_y) )
        ))
        );end foreach
      );end while
);end
);end

该用户从未签到

182#
发表于 2010-12-17 11:38 | 只看该作者
THANKS

该用户从未签到

183#
发表于 2010-12-18 13:22 | 只看该作者
很好来看看
头像被屏蔽

该用户从未签到

184#
发表于 2010-12-19 21:35 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

该用户从未签到

185#
发表于 2010-12-23 16:42 | 只看该作者
good!!!

该用户从未签到

186#
发表于 2010-12-23 16:49 | 只看该作者
回复 deargds 的帖子

其实不错,不过好像没有undo选项

该用户从未签到

187#
发表于 2010-12-27 22:47 | 只看该作者
非常感谢

该用户从未签到

188#
发表于 2010-12-28 11:32 | 只看该作者
希望这个功能好用。。。

该用户从未签到

189#
发表于 2010-12-28 21:28 | 只看该作者
谢谢,好东西。

该用户从未签到

190#
发表于 2010-12-31 16:56 | 只看该作者
这个SKILL太提高效率了,谢谢LZ
  • TA的每日心情
    开心
    2021-4-7 15:27
  • 签到天数: 1 天

    [LV.1]初来乍到

    191#
    发表于 2011-1-14 11:28 | 只看该作者
    Thanks of  your kind ...
  • TA的每日心情
    开心
    2019-11-20 15:20
  • 签到天数: 2 天

    [LV.1]初来乍到

    192#
    发表于 2011-1-18 21:22 | 只看该作者
    谢谢

    该用户从未签到

    193#
    发表于 2011-1-19 14:44 | 只看该作者
    学习中!

    该用户从未签到

    194#
    发表于 2011-1-20 09:44 | 只看该作者
    看起来很需要啊,感谢

    该用户从未签到

    195#
    发表于 2011-1-26 15:08 | 只看该作者
    好东西收藏了。
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-7-5 13:56 , Processed in 0.109375 second(s), 20 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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