EDA365电子论坛网

标题: 求一个点击shape能够显示最大高度的skill [打印本页]

作者: Daisy_R    时间: 2022-7-18 13:53
标题: 求一个点击shape能够显示最大高度的skill
具体是创建一个层,器件封装里面的shape,点击shape之后就能在这个层里面显示出来!
作者: maplantlfya    时间: 2022-7-18 15:12
建议你去看看placebound具体是干什么的
作者: Daisy_R    时间: 2022-7-18 15:50
刘峰 发表于 2022-07-18 15:12:03
建议你去看看placebound具体是干什么的


大概是我pcb完成后,在placebound层点击器件shape就会有最大高度显示

作者: maplantlfya    时间: 2022-7-18 16:13
Daisy_R 发表于 2022-7-18 15:50
大概是我pcb完成后,在placebound层点击器件shape就会有最大高度显示

这需要你在做封装放placebound的时候添加器件高度信息,后期你在PCB里面才能查看高度信息

作者: Daisy_R    时间: 2022-7-18 16:48
刘峰 发表于 2022-07-18 16:13:35
[quote]Daisy_R 发表于 2022-7-18 15:50
大概是我pcb完成后,在placebound层点击器件shape就会有最大高度显示

这需要你在做封装放placebound的时候添加器件高度信息,后期你在PCB里面才能查看高度信息
[/quote]

有高度信息,想要高度文字显示在板上

作者: db-_-    时间: 2022-7-19 10:11
你是说点击placebound层的shape之后,将shape的高度显示到丝印层吧。

我这有个一键输出所有placebound层shape的高度信息到特定层的代码。如果你有SKILL基础需要自己改。
作者: 子木_eda    时间: 2022-7-19 15:04
建议你去看看placebound具体是干什么的
作者: Daisy_R    时间: 2022-7-20 10:33
db-_- 发表于 2022-07-19 10:11:17
你是说点击placebound层的shape之后,将shape的高度显示到丝印层吧。

我这有个一键输出所有placebound层shape的高度信息到特定层的代码。如果你有SKILL基础需要自己改。


对的对的就是这个

作者: Daisy_R    时间: 2022-7-21 10:54
db-_- 发表于 2022-07-19 10:11:17
你是说点击placebound层的shape之后,将shape的高度显示到丝印层吧。

我这有个一键输出所有placebound层shape的高度信息到特定层的代码。如果你有SKILL基础需要自己改。


可以方便分享一下吗?

作者: dhhdbdbvdv    时间: 2022-8-25 20:23
db-_- 发表于 2022-07-19 10:11:17
你是说点击placebound层的shape之后,将shape的高度显示到丝印层吧。

我这有个一键输出所有placebound层shape的高度信息到特定层的代码。如果你有SKILL基础需要自己改。


你好,

作者: dhhdbdbvdv    时间: 2022-8-25 20:24
db-_- 发表于 2022-07-19 10:11:17
你是说点击placebound层的shape之后,将shape的高度显示到丝印层吧。

我这有个一键输出所有placebound层shape的高度信息到特定层的代码。如果你有SKILL基础需要自己改。


大佬,求分享

作者: db-_-    时间: 2023-6-2 11:29

好几年前写的,从一个skill里摘出来的,一直没优化过,不能直接使用,仅供参考。
  1. ;;添加高度信息
  2. procedure(_dbAddHeightInfo(heightClass myLayer)
  3. (let (i myHeight myRotation myOrient myOffset myCerter textHeight uFc tmp p)

  4.         uFc = axlMKSConvert(1 "mils" car((axlDBGetDesignUnits)))
  5.        
  6.         axlVisibleDesign(nil)                ;关闭视图
  7.         axlVisibleLayer(strcat("PACKAGE GEOMETRY/PLACE_BOUND_" myLayer) t)        ;打开层
  8.         axlVisibleLayer(strcat(heightClass myLayer) t)
  9.         axlVisibleUpdate(nil)                ;显示生效
  10.         axlClearSelSet()                        ;清空选择
  11.         axlSetFindFilter(?enabled `("NOALL" "SHAPES") ?onButtons `("SHAPES"))
  12.         axlAddSelectAll()                        ;选择所有shape
  13.                                
  14.         /* p = axlGetParam("paramTextBlock:38")        ;修改字体
  15.         p->width = 20.0 * uFc
  16.         p->height = 25.0 * uFc
  17.         p->lineSpace = 1.0 * uFc
  18.         p->photoWidth = 4.0 * uFc
  19.         p->charSpace = 1.0 * uFc
  20.         axlSetParam(p) */
  21.        
  22.         foreach(i axlGetSelSet()        ;遍历shape
  23.                 when(i->parent                        ;过滤掉假shape
  24.                         myRotation = mod(round(i->parent->rotation) 180)        ;方向信息转换归一
  25.                         when(myRotation == 135 myRotation = 315)                        ;135度单独处理
  26.                         textHeight = axlGetParam("paramTextBlock:2")->height        ;得到字体信息
  27.                         myOffset = case(myRotation                ;根据字体信息计算偏移;可以改成sin和cos,需要确认。
  28.                                                 (0                list(0 ,                                                 - textHeight / 2))
  29.                                                 (90                list(textHeight / 2 ,                        0))
  30.                                                 (45                list(textHeight / 2.8285 ,                - textHeight / 2.8285))
  31.                                                 (315        list(- textHeight / 2.8285 ,        - textHeight / 2.8285))
  32.                                                 (t                list(0 ,                                                 0))
  33.                         )
  34.                         myCerter = axlMXYAdd(trBBoxCenter(i->bBox) myOffset)        ;根据偏移计算text的正中心
  35.                         myOrient = make_axlTextOrientation(?textBlock "2", ?rotation myRotation, ?mirrored nil, ?justify "center")        ;选择字体
  36.                         if(tmp = i->prop->PACKAGE_HEIGHT_MAX then
  37.                                 myHeight = atof(car(parseString(tmp))) / uFc * 25.4 / 1000        ;高度信息转换成毫米
  38.                                 when(myHeight >= 1.0                                ;高度大于该值才处理
  39.                                         axlDBCreateText(sprintf(nil "%.2f" myHeight) myCerter myOrient strcat(heightClass myLayer))        ;创建Text
  40.                                 )
  41.                         else
  42.                                 axlDBCreateText("N/A" myCerter myOrient strcat(heightClass myLayer))        ;创建Text
  43.                         )
  44.                 )
  45.         )
  46.         axlClearSelSet()
  47. ))
复制代码







欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2