|
本帖最后由 ning58 于 2015-4-16 17:28 编辑
完全自己用API方法编制的程序,运行结果提示如上图。
Function Create2View(SwDraw As DrawingDoc, AsmPrt, ConfName, View1, X1, Y1, View2, X2, Y2, oScale, RegExp As RegExp)
Dim ViewName, SwView As View, SwView1 As View
ViewName = "Front"
ViewName = "前视"
''
With SwDraw
''''
Set SwView = .CreateDrawViewFromModelView3(AsmPrt, "*" & ViewName, X1 / 1000, Y1 / 1000, 0) ''
SwView.SetName2 View1
''
Set SwView1 = .CreateUnfoldedViewAt3(X2 / 1000, Y2 / 1000, 0, False) '
SwView1.SetName2 View2
''
''
.InsertModelAnnotations3 0, swInsertDimensionsMarkedForDrawing, True, True, True, False
''
.InsertModelAnnotations3 0, swInsertDimensions, True, True, True, False
''Debug.Print SwView.Name,
SwView.ScaleDecimal = 1 / oScale
SwView.ReferencedConfiguration = ConfName
SwView1.ReferencedConfiguration = ConfName
'Stop
End With
''
If Not RegExp Is Nothing Then
delDim SwDraw, SwView, RegExp
End If
With SwDraw
.ForceRebuild3 True
.ViewZoomtofit
End With
End Function
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|