Ver código fonte

CQL 曲线长度用法示例笔记

蘭雅sRGB 10 meses atrás
pai
commit
1d915f7139
1 arquivos alterados com 24 adições e 0 exclusões
  1. 24 0
      base/Same_CurveLength.bas

+ 24 - 0
base/Same_CurveLength.bas

@@ -0,0 +1,24 @@
+Sub CurveLength()
+ Dim s As Shape
+ Set s = ActiveSelection.Shapes(1)
+ If s.Type = cdrCurveShape Then
+  MsgBox s.Curve.Length
+ End If
+ 
+ ActivePage.Shapes.FindShapes(Query:="@type ='curve' and @com.curve.length=3").CreateSelection
+End Sub
+
+
+Sub Same_CurveLength()
+ Dim s As Shape
+ Dim cl As Double
+ Dim cql As String
+   
+ Set s = ActiveSelection.Shapes(1)
+ If s.Type = cdrCurveShape Then
+  cl = s.Curve.Length
+  cql = "@type ='curve' and (@com.curve.length - " & cl & ").abs() < 0.1"
+  ActivePage.Shapes.FindShapes(Query:=cql).CreateSelection
+ End If
+
+End Sub