创建CAD选择集过滤简单方法

yjgyjgg 2021-7-15 9544

Sub CreateSSeFilter cdecl(filtertype as VARIANT ,filterdata as VARIANT,count as Integer,...)
   dim i as Integer ,ft()As short ,fd() as VARIANT
   Dim arg as cva_list
   cva_start(arg ,Count)
   dim vft as CVar
   redim ft(count / 2 -1)
   redim fd(count / 2-1)
   dim cfarry as CSafeArray Ptr = New CSafeArray(vt_variant ,count/2 ,0)
   for i = 0 To count-1
      If i Mod 2 = 0 then
         ft(i / 2) = cva_arg(arg ,short)
      else
         fd((i -1) / 2) = *cva_arg(arg ,VARIANT ptr)
         cfarry->put((i -1) / 2,@fd((i -1) / 2))
      End If
   Next
   cva_end(arg)
   vft.PutShortArray(@ft(0),UBound(ft)+1)
   filtertype = vft
   cfarry->CopyToVariant(@filterdata)
End Sub

Function ToPoint(ByVal a As Double ,ByVal b As Double ,ByVal c As Double) As VARIANT'创建点
   Dim v    As cvar ptr = new CVAR
   Dim p(2) As Double   = {a ,b ,c}
   v->putDoubleArray(@p(0) ,3)
   Return v->vd
End Function

调用方法CreateSSetFilter(FT ,FD ,12,0 ,"Circle" ,8 ,"0" , -4 ,"=" ,40 ,25.0,-4,"=,=,=",10,CObjet(topoint(12,344,4324)).sptr)

因国家互联网安全管理要求,关闭回帖功能。大家需要留言,请使用【勇芳软件客服】即时联系勇芳点此打开->>勇芳软件客服
返回
联系勇芳
发新帖 搜索 反馈 回顶部