各位大侠,兄弟有一个VBA 转 Delphi得问题一直解决不了。请大家帮忙看看。Public Sub SetPartColor()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument Dim oRenderStyle As RenderStyle
Set oRenderStyle = oPartDoc.RenderStyles.Item("Red") oPartDoc.ActiveRenderStyle = oRenderStyle ThisApplication.ActiveView.Update
End Sub请问这段代码想转成 Delphi 我应该怎么写呢,
还有一段也是 VBA转 Delphi的 ,我转完也老出错,也请大家帮忙看看Public Sub MateConstraintOfWorkPlanes()Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef =ThisApplication.ActiveDocument.ComponentDefinitionDim oOcc1 As ComponentOccurrence
Set oOcc1 = oAsmCompDef.Occurrences.Item(1)
Dim oOcc2 As ComponentOccurrence
Set oOcc2 = oAsmCompDef.Occurrences.Item(2)Dim oPartPlane1 As WorkPlane
Set oPartPlane1 = oOcc1.Definition.WorkPlanes.Item(3)
Dim oPartPlane2 As WorkPlane
Set oPartPlane2 = oOcc2.Definition.WorkPlanes.Item(3)Dim oAsmPlane1 As WorkPlaneProxy
Call oOcc1.CreateGeometryProxy(oPartPlane1, oAsmPlane1)
Dim oAsmPlane2 As WorkPlaneProxy
Call oOcc2.CreateGeometryProxy(oPartPlane2, oAsmPlane2)Call oAsmCompDef.Constraints.AddMateConstraint(oAsmPlane1,oAsmPlane2, 0)
End Sub谢谢大家了
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument Dim oRenderStyle As RenderStyle
Set oRenderStyle = oPartDoc.RenderStyles.Item("Red") oPartDoc.ActiveRenderStyle = oRenderStyle ThisApplication.ActiveView.Update
End Sub请问这段代码想转成 Delphi 我应该怎么写呢,
还有一段也是 VBA转 Delphi的 ,我转完也老出错,也请大家帮忙看看Public Sub MateConstraintOfWorkPlanes()Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef =ThisApplication.ActiveDocument.ComponentDefinitionDim oOcc1 As ComponentOccurrence
Set oOcc1 = oAsmCompDef.Occurrences.Item(1)
Dim oOcc2 As ComponentOccurrence
Set oOcc2 = oAsmCompDef.Occurrences.Item(2)Dim oPartPlane1 As WorkPlane
Set oPartPlane1 = oOcc1.Definition.WorkPlanes.Item(3)
Dim oPartPlane2 As WorkPlane
Set oPartPlane2 = oOcc2.Definition.WorkPlanes.Item(3)Dim oAsmPlane1 As WorkPlaneProxy
Call oOcc1.CreateGeometryProxy(oPartPlane1, oAsmPlane1)
Dim oAsmPlane2 As WorkPlaneProxy
Call oOcc2.CreateGeometryProxy(oPartPlane2, oAsmPlane2)Call oAsmCompDef.Constraints.AddMateConstraint(oAsmPlane1,oAsmPlane2, 0)
End Sub谢谢大家了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货