markgoob 发表于 2024-4-12 10:19:00

询问修改叠构里的参数语法

开发手册中只有纪载这个函数,但这函数只能增叠构不能改参数

axlLayerCreateCrossSection()

-> 而以下语法虽能改参数 但效率挺差的

xsec_list = axlGetXSection();获取所有叠构资讯list

;--- 针对list内容修改 ---
(略过)
;----------

_fpBioImportXSection(xsec_list_new) ;把叠构重写回去

想问版上的大佬们是否有更高效的语法

markgoob 发表于 2024-4-12 14:09:07

自己找到Bug了 給有需要的大佬參考

原本是這樣,Layer有設PLANE Type但原先我只設CONDUCTOR Type,
導致寫回疊構時遇到PLANE Type會有Bug

if(Layer_Function == "CONDUCTOR" then ... )


xsec_list = axlGetXSection()
xsec_list_new = nil

foreach(s_xsec xsec_list

Layer_name = nth(0 s_xsec)
Layer_Function = nth(1 s_xsec)
Layer_Th_Val = nth(3 s_xsec)

when(Layer_Th_Val == "0 mil"
Layer_Th_Val = "3.90 mil"
)


if(Layer_Function == "SURFACE" then
xsec_list_new = cons(s_xsec xsec_list_new)
)

if(Layer_Function == "DIELECTRIC" then
xsec_list_new = cons(list("" "DIELECTRIC" "FR-4" Layer_Th_Val "0 w/cm-degC" "0 mho/cm" "4.200000" nil nil "0.02" "" nil nil nil "0.000000")xsec_list_new)
)

if(Layer_Function == "CONDUCTOR" then
xsec_list_new = cons(list(Layer_name "CONDUCTOR" "COPPER" Layer_Th_Val "0 w/cm-degC" "595900 mho/cm" "4.200000" nil nil "0.02" "" "4.200000" "0.02" nil "90.000000") xsec_list_new)
)

)

xsec_list_new = reverse(xsec_list_new) ;反轉整個list

_fpBioImportXSection(xsec_list_new)


修正過後如下

if(Layer_Function == "CONDUCTOR" || Layer_Function == "PLANE" then ...)

xsec_list = axlGetXSection()
xsec_list_new = nil

foreach(s_xsec xsec_list

Layer_name = nth(0 s_xsec)
Layer_Function = nth(1 s_xsec)
Layer_Th_Val = nth(3 s_xsec)

when(Layer_Th_Val == "0 mil"
Layer_Th_Val = "3.90 mil"
)


if(Layer_Function == "SURFACE" then
xsec_list_new = cons(s_xsec xsec_list_new)
)

if(Layer_Function == "DIELECTRIC" then
xsec_list_new = cons(list("" "DIELECTRIC" "FR-4" Layer_Th_Val "0 w/cm-degC" "0 mho/cm" "4.200000" nil nil "0.02" "" nil nil nil "0.000000")xsec_list_new)
)

if(Layer_Function == "CONDUCTOR" || Layer_Function == "PLANE" then
xsec_list_new = cons(list(Layer_name "CONDUCTOR" "COPPER" Layer_Th_Val "0 w/cm-degC" "595900 mho/cm" "4.200000" nil nil "0.02" "" "4.200000" "0.02" nil "90.000000") xsec_list_new)
)

)

xsec_list_new = reverse(xsec_list_new) ;反轉整個list

_fpBioImportXSection(xsec_list_new)


有62層CONDUCTOR 原先要耗時7分鐘,修正後目前只需13秒

winskillabc 发表于 2024-5-8 11:47:34

历害,学习一下
页: [1]
查看完整版本: 询问修改叠构里的参数语法