Jump to content

SolidEdge COM Object


Recommended Posts

Hi to all,

I try to make an automation script for my SolidEdge Drafts, But I have a problem when I try to get objects.

Explaining in basic,

The code at below returns as an Object and It creates a draft.

$de = ObjCreate("SolidEdge.DraftDocument")
MsgBox(0,"",VarGetType($de))

But in this, it's a string, so I cant do anything on existing and opened draft.

$de = ObjGet("","SolidEdge.DraftDocument")
MsgBox(0,"",VarGetType($de))

Whats the problem about the ObjGet?

On the other hand, the VB6 codes in Excel works healthy, and I can get info from Table in exist Draft

Set objApp = GetObject(, "SolidEdge.Application")
Set objDoc = objApp.ActiveDocument
Set objTables = objDoc.Tables
Set objTable = objTables.Item(1)
Set objTitles = objTable.Titles
Set objTitle = objTitles.Item(1)
Set objColumns = objTable.Columns
Set objColumn = objColumns.Item(1)

Could you help me about that, what the problem or where do I do wrong?

 

Thank you,

Link to comment
Share on other sites

0x80020006 stands for DISP_E_UNKNOWNNAME - unknown name as described here: https://www.hresult.info/FACILITY_DISPATCH/0x80020006

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Seems as this document provides some neeeded information: https://www.plm.automation.siemens.com/zh_cn/Images/Solid_Edge_API_tcm78-125829.pdf (starting with pge 27).

I think the first statements should be:

#include <MsgBoxConstants.au3>
Global $oApp = ObjGet("", "SolidEdgeFramework.Application") ; Connects to an already running instance of the framework
If @error Then
    $oApp = ObjCreate(""SolidEdgeFramework.Application") ; Starts up the framework
    If @error Or Not IsObj($oApp) Then Exit MsgBox($MB_ICONERROR, "Could not start the SolidEdgeFramework!" & @CRLF & _
      "@error=" & @error & "@extended=" & @extended)
 EndIf

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

image.thumb.png.be31f45a11486e70d5bd250a2c158183.png

Actually, I think It's not right, but I tried your script. Its same error message. It's not right because I use OleView.Net and in RO Table I can see the SolidEdge.DraftDocument and SolidEdge.Application but there is no SolidEdgeFramework.Application. 

Additionally when I use the ObjCreate with Solidedge.DraftDocument, it creates a Draft with "Untitled" name. Its related with ObjGet. 

Link to comment
Share on other sites

Here you find a lot of Visual basic examples - should be easy to translate them to autoIt: https://github.com/SolidEdgeCommunity/Samples

BTW: I know nothing about SolidEdge, just a little bit about COM and Autoit coding.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If you can create the objects in VB6, you can probably also create the objects in VBScript. Since we through the use of ROT objects have a virtually complete integration of VBScript and AutoIt code, you can in all probability use the techniques as described in this post to create the objects in VBScript and then pass them to AutoIt through a ROT object.

Link to comment
Share on other sites

I tried but it was not successfull unfortuntaly.

By the way, I discovered a point about the Excel VBA.

For using the object in Excel, you must add "references" from tools menu. The references are *.TLB files. How can I import them to my script?

Or many user who wrote script for SolidEdge, use the Interop.Solidedge tool. But How can I use it on my autoit script. I dont know.

Can you find a way to use one of them? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...