求大神!将这段vbs如何转换成vb!!!,要vb6的
DimoAnsoftAppDimoDesktopDimoProjectDimoDesignDimoEditorDimoModuleSetoAnsoftApp=Create...
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee1")
oProject.SaveAs "D:\Ansoft\Tee2.hfss", true
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
oDesign.SetSolutionType "DrivenModal"
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.SetModelUnits Array("NAME:Units Parameter", "Units:=", "in", "Rescale:=", _
false)
oEditor.CreateBox Array("NAME:BoxParameters", "CoordinateSystemID:=", -1, "XPosition:=", _
"0in", "YPosition:=", "0in", "ZPosition:=", "0in", "XSize:=", "2in", "YSize:=", _
"0.9in", "ZSize:=", "0.4in"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", _
"", "Color:=", "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", _
"Global", "MaterialName:=", "vacuum", "SolveInside:=", true) 展开
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee1")
oProject.SaveAs "D:\Ansoft\Tee2.hfss", true
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
oDesign.SetSolutionType "DrivenModal"
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.SetModelUnits Array("NAME:Units Parameter", "Units:=", "in", "Rescale:=", _
false)
oEditor.CreateBox Array("NAME:BoxParameters", "CoordinateSystemID:=", -1, "XPosition:=", _
"0in", "YPosition:=", "0in", "ZPosition:=", "0in", "XSize:=", "2in", "YSize:=", _
"0.9in", "ZSize:=", "0.4in"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", _
"", "Color:=", "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", _
"Global", "MaterialName:=", "vacuum", "SolveInside:=", true) 展开
4个回答
展开全部
不用转换吧,直接新建一个Sub把代码放进去就行了,用的时候调用就行:
Sub VBSSub()
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee1")
oProject.SaveAs "D:\Ansoft\Tee2.hfss", true
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
oDesign.SetSolutionType "DrivenModal"
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.SetModelUnits Array("NAME:Units Parameter", "Units:=", "in", "Rescale:=", _
false)
oEditor.CreateBox Array("NAME:BoxParameters", "CoordinateSystemID:=", -1, "XPosition:=", _
"0in", "YPosition:=", "0in", "ZPosition:=", "0in", "XSize:=", "2in", "YSize:=", _
"0.9in", "ZSize:=", "0.4in"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", _
"", "Color:=", "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", _
"Global", "MaterialName:=", "vacuum", "SolveInside:=", true)
End Sub
Sub VBSSub()
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee1")
oProject.SaveAs "D:\Ansoft\Tee2.hfss", true
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
oDesign.SetSolutionType "DrivenModal"
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.SetModelUnits Array("NAME:Units Parameter", "Units:=", "in", "Rescale:=", _
false)
oEditor.CreateBox Array("NAME:BoxParameters", "CoordinateSystemID:=", -1, "XPosition:=", _
"0in", "YPosition:=", "0in", "ZPosition:=", "0in", "XSize:=", "2in", "YSize:=", _
"0.9in", "ZSize:=", "0.4in"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", _
"", "Color:=", "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", _
"Global", "MaterialName:=", "vacuum", "SolveInside:=", true)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
........代码?在哪?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的VBS代码呢?请贴出来
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询