Hi,
I am trying to access "Inventor.Application" through "COM_connectRunningServer". Below is the sample code for the same.
Dim
inventor AsUser = COM_connectRunningServer_("Inventor.Application")
When I run this through ETO server, I am getting the below error message.
Server "Inventor.Application" is not defined or not registered correctly.
I can run this properly on Inventor + Intent system.
Thanks,
Santosh K.
Hi Santosh,
I think you should use %%InventorApplication instead. That returns a .Net object that you can use to access Inventor. It will work with both ETO Series and ETO Server.
As to why your call isn't working, I don't know for sure, but I wouldn't be suprised if "Inventor.Application" COM access was not supported for Inventor Server. ETO Server makes use of Inventor Server under the covers, it is not full Inventor.
Thanks,
Ray
Hi Ray,
Please find below the rule I am using. I have modified it as per your instructions. However now it shows that "%%InventorApplication" is not defined....
Uncached
Rule CreateSAT AsString
Dim inventor AsUser = COM_connectRunningServer_("%%InventorApplication")
Dim OpenDocument AsUser = COM_getProperty_(inventor, "Documents")
Dim i AsInteger
Dim ActiveDocObject1 AsUser
Dim FileName AsString
For i = 1 To length(PartsForOutput)
FileName = outputLocation +
"\SATOutput\" + nth(i,PartsForOutput).DisplayName + ".SAT"
COM_methodcall_( OpenDocument,
"Open",nth(i,PartsForOutput).CacheFileName ,True)
ActiveDocObject1 = COM_getProperty_(inventor,
"ActiveDocument")
COM_methodcall_( ActiveDocObject1,
"SaveAs", FileName ,True)
COM_methodcall_( ActiveDocObject1,
"Close", True)
Next
COM_releaseDispatch_( ActiveDocObject1 )
COM_releaseDispatch_( OpenDocument )
COM_releaseDispatch_( inventor)
Return displayName'
End Rule
Thanks,
Santosh
Try something like this:
Design MyInventorUtilities : walkwaysRoot
Method createReportImage() As String
Dim outputFile = "c:\temp\ReportImage.jpg"
Dim view = %%inventorApplication.ActiveView
Dim hasGnomon As Boolean = %%inventorApplication.DisplayOptions.Show3DIndicator
Dim displayMode = view.DisplayMode
Dim hasGroundShadow As Boolean = view.ShowGroundShadows
Dim hasAmbientShadow As Boolean = view.ShowAmbientShadows
Dim hasObjectShadows As Boolean = view.ShowObjectShadows
'
%%inventorApplication.DisplayOptions.Show3DIndicator = False
'view.ShowGroundShadows = True
view.ShowAmbientShadows = True
view.ShowObjectShadows = True
view.DisplayMode = Inventor.DisplayModeEnum.kRealisticRendering
view.RayTracingQuality=Inventor.RayTracingQualityEnum.kInteractiveRayTracingQuality
'view.GoHome()
Try
view.SaveAsBitmap(outputFile, 1200, 800)
Finally
%%inventorApplication.DisplayOptions.Show3DIndicator = hasGnomon
view.DisplayMode = displayMode
view.ShowGroundShadows = hasGroundShadow
view.ShowAmbientShadows = hasAmbientShadow
view.ShowObjectShadows = hasObjectShadows
End Try
Return outputFile
End Method
End Design
Hi Sanathos
Sorry for the confusion, %%InventorApplication is an Intent Rule of type Inventor.Application, you don't need the COM_Connect or COM_getProperty, or any other COM stuff. Just use it like this:
%%InventorApplication.GeneralOptions.TextSize, %%InventorApplication.Documents, etc. Refer to the Inventor API docs for all the methods available.
Thanks,
Ray
Hi,
%%InventorApplication works on Inventor + Inventor ETO Component machine. However when I tried to use it on ETO Server it gives same error message.
%%InventorApplication is not defined or not registered
Thanks,
Santosh K.
Hi Santosh,
What exactly are you running? Are you running this from the Intent Session Manager service, using the Server Configurator to setup your application? Is this a batch mode application run with InventorETOServer.exe? I'm not sure how either of those contexts could not find Inventor Server but it is a start to begin troubleshooting.
Can you also try to run InventorETOServer -i from the command and report back the results. It is located in the server install "bin" directory.
Thanks,
Ray
Hi Ray,
I am running it on Inventor ETO Server machine with a web UI using the WCF service to start Intent Application.
Thanks,
Santosh
ok, on the server machine please try to run:
InventorETOServer -i
from the command line and report back the results. It is located in the server install "bin" directory. This will tell us if your issue is a general problem with Inventor Server or a problem with the WCF Service.
Thanks,
Ray
Hi Ray,
Please find below the output of "InventorETOServer.exe -i" command.
Thanks,
Santosh K.
Hi Santosh,
ok, that all looks ok. I just tried a very simple test with something like this:
Parameter Rule MyRule as Any = %%InventorApplication.Documents.Count
can you add that rule, evaluate and see what happens? It worked fine for me.
Thanks,
Ray