如何获取一个layer shape的所有corner点坐标并计算该shape面积?求skill脚本
该shape的面积也需要得出来?求skill脚本
多谢!
其实用icc或者SOC画然后导出来更快吧
skill赶脚要写一会儿了
选中那个多边形,在ciw里面输入geGetSelSet()~>points 对矩形不适用
如果是矩形,那要把points改bBox
或者car(geGetSelSet())
ps:615里现成的。
615里现成的是什么意思?菜单里面就有么?
turbo tools里,需要有xl 的license
那你知道,怎么把刚才命令的信息输出到一个文本中么?
唔知
坐等结果
http://bbs.eetop.cn/thread-352246-1-1.html
这个小程序中已经有这个功能了,在usermenu的菜单下面有一个extract information的命令
是的,面积的那个是有
那各个坐标点的那个,输出到一个文本怎么弄呢?
实在是看不下去了,贴上一个大神多年前写的脚本。
/*
Synopsis:JW_Area()
Version:1.0
Create Date :2006-03-28
Author:Justin Wang
E-Mail:justin727@gmail.com
*/
;hiSetBindKey("Layout" "<Key>3" "JW_Area()")
procedure(JW_Area()
prog((cvId selObj area number shape Box points point1 point2 length width )
cvId = getEditRep(hiGetCurrentWindow())
selObj = geGetSelSet(cvId)
number = length(selObj)
if(zerop(number) then
JWMessage("Error!" 'Close "Please select a layer." )
return()
)
geDeselectAll(hiGetCurrentWindow())
foreach(shape selObj
area = 0
case( shape~>objType
("rect"
Box = shape~>bBox
area = (car(cadr(Box)) - car(car(Box))) * (cadr(cadr(Box)) - cadr(car(Box)))
)
("polygon"
number = length(shape~>points)
points = shape~>points
points = append(points list(car(points)))
while(!zerop(number)
point1 = car(points)
points = cdr(points)
point2= car(points)
area = area + ( car(point1) * cadr(point2) )
area = area - ( car(point2) * cadr(point1) )
number--
);while
area = abs(area/2)
)
("path"
number = shape~>nPoints
points = shape~>path
width = shape~>width
while(!zerop(number-1)
point1 = car(points)
points = cdr(points)
point2 = car(points)
if(equal(car(point1) car(point2))
length = abs(cadr(point1) - cadr(point2))
length = abs( car(point1) -car(point2))
);if
area = area + length * width
number--
);while
case(shape~>pathStyle
("extendExtend" area = area + width*width )
("varExtendExtend" area = area + (shape~>beginExt+shape~>endExt)*width )
("roundRound" area = area +4/9.0 * width * width ) ;(w/3^2) * 4
(t);truncateExtend
);case
)
(t
area = 0.0
)
);case
geSelectObject(shape)
if(zerop(area) then
JWMessage("Error!" 'Close "This is not a layer.")
sprintf(area "Area = unknown")
else
sprintf(area "Area = %f" area)
)
JWMessage("Layer Area" 'Close area)
geDeselectFig(shape)
);foreach
);prog
);procedure
;-------------------------------------------------------
procedure(JWMessage(title button message)
prog( ()
hiDisplayAppDBox(
?name'JWDBox
?dboxBanner title
?buttonLayout button
?dboxText message
)
);prog
);procedure
多谢啦!
贴上看看,希望有用
感谢无私的分享
请问你是已经成功获得计算多边形面积的SKILL脚本了吗?可以分享一下吗?
IC616里自带这个功能,放心用吧
你好,可以具体一点在自带的功能在哪里吗?表示找不到,或者有IC616的使用文档也可以分享一下的,谢谢
谢谢分享!