如何判断对象是其中的一员
请问如何判断:entsel对象是不是("LINE" "ARC" "CIRCLE" "LWPOLYLINE" "SPLINE" "ELLIPSE" "POLYLINE")其中的一员本帖最后由 自贡黄明儒 于 2024-7-24 13:09 编辑
(member "LINE"(list "LINE" "ARC" "CIRCLE" "LWPOLYLINE" "SPLINE" "ELLIPSE" "POLYLINE"))
白度AI回答:
Public Function IsCurve(line As AcadLine) As Boolean
If line.GeometricExtension = acExtCurve Then
IsCurve = True
Else
IsCurve = False
End If
End Function
其实这种基础问题最好还是好好看看lisp函数,大概就可以找到答案
vl-position函数就可以
(vl-position (cdr (assoc 0 (entget (car (entsel))))) (list "LINE" "ARC" "CIRCLE" "LWPOLYLINE" "SPLINE" "ELLIPSE" "POLYLINE"))
用wcmatch就可以了,所有line可以用*line代替
(wcmatch(cdr (assoc 0 (entget (car (entsel)))))"*LINE,ARC,CIRCLE,ELLIPSE") 我只想到了member函数... 自贡黄明儒 发表于 2024-7-24 09:27
(member "LINE"(list "LINE" "ARC" "CIRCLE" "LWPOLYLINE" "SPLINE" "ELLIPSE" "POLYLINE"))
可以用or函数吗 wzs07 发表于 2024-7-24 11:01
可以用or函数吗
or太麻烦,给你总结一下:
1 vl-position
2 member
3 wcmatch
4 vlax-curve-getStartPoint
tryhi 发表于 2024-7-24 10:00
用wcmatch就可以了,所有line可以用*line代替
(wcmatch(cdr (assoc 0 (entget (car (entsel)))))"*LINE, ...
这个好玩,有用,学到了:loveliness: 厉害,学习了 自贡黄明儒 发表于 2024-7-24 12:55
or太麻烦,给你总结一下:
1 vl-position
2 member
vl-member-if
vl-remove-if-not
也可以
vlax-curve-getStartPoint 不知怎样用?
页:
[1]
2