怡然 发表于 2003-7-29 21:07:00

已知距离和角度的倒角如何实现?

MDT的VBA reference帮助文件中有一个例程:

Sub CreateSketches()

......
Dim feat As McadFeature
Set feat = part.AddFeature(extrude)

' Get the cylindrical face
   
Dim face As IMcadSurface
Dim found As Boolean

found = False
Dim bounded As GeBoundedSurface
For Each face In feat.faces
    Set bounded = face.Geometry
    If TypeOf bounded.BaseSurface Is GeCylinder Then
      found = True
      Exit For
    End If
Next
If Not found Then Exit Sub
   
Dim dist As McadValue
Set dist = util.CreateValue
dist.value = 1

Dim ang As McadValue
Set ang = util.CreateValue
ang.value = 30

' set the chamfer descriptor
Dim chamferDescrip As McadChamferDescriptor
Set chamferDescrip = util.CreateFeatureDescriptor(mcChamfer)

chamferDescrip.ChamferType = mcDistanceAngle
chamferDescrip.Distance1 = dist
chamferDescrip.angle = ang
chamferDescrip.face = face
   
Dim chamferFeat As McadFeature
Set chamferFeat = part.AddFeature(chamferDescrip)
......


我改动了以上的代码,想试一试已知距离和角度如何画出倒角,但程序运行到
chamferDescrip.face = face
时,显示 "类型不匹配" 的错误

请高手指点

mccad 发表于 2003-8-1 17:58:00

MDT和AutoCAD的对象模型不同。

怡然 发表于 2003-8-5 21:06:00

从MDT自带的McadVBA Developer's Guide中可以找到一个例程AddChamfer(),它演示了如何生成已知两个距离的倒角,但是要做出已知距离和角度的倒角,现在我还没做出来.

gzy 发表于 2003-10-1 16:17:00

能不能直接实现啊?
页: [1]
查看完整版本: 已知距离和角度的倒角如何实现?