Continue to Site

Reply to thread

I am tring to build a COMSOL project file from EXCEL using the COMSOL excel addon.

My code shown below fails on the "GEO Line.


I get this error:



Anybody can help?

Thank you



[syntax=vb]

Sub comsol_vbs_test()

Set comsolutil = CreateObject("comsolcom.comsolutil")

Set modelutil = CreateObject("comsolcom.modelutil")

Call comsolutil.TimeOutHandler(True)

Call comsolutil.StartComsolServer(True)

Call modelutil.Connect

Set modelutil = CreateObject("ComsolCom.ModelUtil")

Dim model As ModelImpl

Set model = modelutil.Create("Model")

Call model.modelPath("G:\MyDocuments\comsol\PROJECTS")

Call model.Comments("Untitled" & vbNewLine & "" & vbNewLine & "")

Call model.ModelNode().Create("comp1")

Call model.geom().Create("geom1", 2)

Call model.get_geom("geom1").axisymmetric(True)

Call model.mesh().Create("mesh1", "geom1")

Call model.physics().Create("emw", "ElectromagneticWaves", "geom1")

Call model.study().Create("std1")

Call model.get_study("std1").Create("freq", "Frequency")

Call model.get_study("std1").get_feature("freq").Activate("emw", True)

Call model.get_component("comp1").geom("geom1").Create("c1", "Circle")

 

Call comsol_server_disconnect


End Sub

Sub comsol_server_disconnect()

Set comsolutil = CreateObject("comsolcom.comsolutil")

Set modelutil = CreateObject("comsolcom.modelutil")

Call comsolutil.TimeOutHandler(True)

Call modelutil.Disconnect

End Sub

[/syntax]


Part and Inventory Search

Back
Top