找回密码
 注册
关于网站域名变更的通知
查看: 308|回复: 2
打印 上一主题 下一主题

{求助}SILK 依照零件本體大小變換 源碼有錯誤

[复制链接]
  • TA的每日心情
    慵懒
    2019-11-18 15:01
  • 签到天数: 1 天

    [LV.1]初来乍到

    跳转到指定楼层
    1#
     楼主| 发表于 2025-4-30 16:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

    EDA365欢迎您登录!

    您需要 登录 才可以下载或查看,没有帐号?注册

    x
    請大佬幫忙除錯


    *WARNING* (reader): a '(' at line 2 was still unclosed on EOF, ')' added
                        at line 69
    *WARNING* (reader): a '(' at line 1 was still unclosed on EOF, ')' added
                        at line 69

    procedure()
        let((texts sym p uFc symBBox assemblyHeight)
            ;; Get unit conversion factor
            if(car(axlDBGetDesignUnits()) == "mils" then
                uFc = 1
            else
                uFc = 25.4 / 1000
            )

            ;; Set visible layers
            axlVisibleDesign(nil)
            axlVisibleLayer("Ref Des/DISPLAY_Top" t)
            axlVisibleLayer("Ref Des/DISPLAY_Bottom" t)
            axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_TOP" t)
            axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_BOTTOM" t)
            axlVisibleUpdate(nil)

            ;; Select all reference designator texts
            axlClearSelSet()
            axlSetFindFilter(?enabled `("noall" "text") ?onButtons `("noall" "text"))
            axlAddSelectAll()

            ;; Process each selected text
            foreach(texts axlGetSelSet()
                sym = texts->parent
                when(sym && texts->text == sym->component->name
                    ;; Get ASSEMBLY layer bounding box
                    symBBox = axlPolyFromDB(sym ?layer strcat("PACKAGE GEOMETRY/ASSEMBLY_" sym->side) ?noFill t ?union t)

                    when(symBBox
                        ;; Calculate ASSEMBLY layer height and set text size to 70%
                        assemblyHeight = yCoord(cadr(symBBox)) - yCoord(car(symBBox))

                        p = axlGetParam("paramTextBlock:13")
                        p->width = assemblyHeight * 0.7 * 0.6  ;; 70% height with 0.6 aspect ratio
                        p->height = assemblyHeight * 0.7        ;; 70% of height
                        p->lineSpace = 0.0 * uFc
                        p->charSpace = 0.0 * uFc
                        p->photoWidth = max(1.0 * uFc, assemblyHeight * 0.7 * 0.05)  ;; min 1mil
                        axlSetParam(p)

                        ;; Modify text properties
                        axlDBChangeText(texts nil 13)

                        ;; Rotate text to match component
                        axlTransformObject(texts ?angle sym->rotation - texts->rotation)

                        ;; Handle upside-down text
                        when(texts->rotation >= 90 && texts->rotation < 270
                            axlTransformObject(texts ?angle 180)
                        )

                        ;; Position text at ASSEMBLY layer center
                        let((assemblyCenter)
                            assemblyCenter = list(
                                (xCoord(car(symBBox)) + (xCoord(cadr(symBBox)) - xCoord(car(symBBox)))/2,
                                (yCoord(car(symBBox)) + (yCoord(cadr(symBBox)) - yCoord(car(symBBox)))/2
                            )
                            axlTransformObject(texts ?move axlMXYSub(assemblyCenter axlDBAltOrigin('center texts)))
                        ) ;; End of inner let
                    ) ;; End of when symBBox
                ) ;; End of when sym && texts->text
            ) ;; End of foreach
            axlClearSelSet()
            axlVisibleUpdate(t)  ;; Final screen update
        ) ;; End of let
    ) ;; End of procedure

    printf("mcenter command loaded. Use 'mcenter' to center reference designators (based on ASSEMBLY layer)\n")

  • TA的每日心情
    郁闷
    2024-7-25 15:18
  • 签到天数: 15 天

    [LV.4]偶尔看看III

    2#
    发表于 2025-5-1 16:12 | 只看该作者
    1.第一行错误
    2.AssemblyCenter创建list时没闭合,里面的表达式都少了反阔号

    该用户从未签到

    3#
    发表于 2025-5-1 21:38 | 只看该作者
    括号不匹配,提示的内容不是error 不影响运行。
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

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

    EDA365公众号

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

    GMT+8, 2025-9-10 03:14 , Processed in 0.109375 second(s), 23 queries , Gzip On.

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

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

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