当前位置:文档之家› Inventor iLogic 工程图模板

Inventor iLogic 工程图模板

doc = ThisDoc.Document
If doc.ActiveSheet.DrawingViews.Count >0 Then
nMass = CDblAny(doc.ActiveSheet.DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument.PropertySets(3).item(39).Expression)/1000
If nMass<100 Then
iProperties.Value("Custom", "质量")=CStr(Round(nMass, 1))
Else
iProperties.Value("Custom", "质量")=CStr(Round(nMass, 0))
End If

iProperties.Value("Custom", "比例")=Replace(doc.ActiveSheet.DrawingViews(1).ScaleString," ","")
Else
iProperties.Value("Custom", "质量")=""
iProperties.Value("Custom", "比例")=""
End If
------------------------------------------------------------------分割线----------------------------------------------------------------------------

On Error Goto Handler
doc = ThisDrawing.ModelDocument

If doc.DocumentType = kAssemblyDocumentObject Then
If ActiveSheet.Size="A3" Or ActiveSheet.Size="A4" Then
ActiveSheet.Border = "GB(A3-A4)"
ActiveSheet.TitleBlock = "GZ_IAM(A3-A4)"
ElseIf ActiveSheet.Size="A0" Or ActiveSheet.Size="A1" Or ActiveSheet.Size="A2" Then
ActiveSheet.Border = "GB(A0-A2)"
ActiveSheet.TitleBlock = "GZ_IAM(A0-A2)"
End If
ElseIf doc.DocumentType = kPartDocumentObject Then
If ActiveSheet.Size="A3" Or ActiveSheet.Size="A4" Then
ActiveSheet.Border = "GB(A3-A4)"
ActiveSheet.TitleBlock = "GZ_IPT(A3-A4)"
ElseIf ActiveSheet.Size="A0" Or ActiveSheet.Size="A1" Or ActiveSheet.Size="A2" Then
ActiveSheet.Border = "GB(A0-A2)"
ActiveSheet.TitleBlock = "GZ_IPT(A0-A2)"
End If
End If

Handler:
Return



If ThisDrawing.Document.ActiveSheet.DrawingViews.Count>0 Then
View1=ThisDrawing.Document.ActiveSheet.DrawingViews(1)
ModelName=IO.Path.GetFileName(ActiveSheet.View(https://www.doczj.com/doc/4e4060847.html,).ModelDocument.FullFileName)
iProperties.Value(ModelName,"Custom", "图纸比例")=View1.ScaleString
https://www.doczj.com/doc/4e4060847.html,=Mid(ModelName,1,9)
If https://www.doczj.com/doc/4e4060847.html,pare(Right(ModelName,3),"ipt")<>0 Then
iProperties.Value(ModelName,"Custom", "质量")=CStr(Round(iProperties.Mass(ModelName),1))
Else
iProperties.Value(ModelName,"Custom", "质量")=CStr(Round(iProperties.Mass(ModelName),2))
End If
Else
https://www.doczj.com/doc/4e4060847.html,="BOM"
End If


相关主题
文本预览
相关文档 最新文档