Jump to content

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 post
Share on other sites

Thank you Ahmet,

I tried also "SolidEdge.Application" it is same. and the error value is also same and it is "-2147352570" I dont know what does it mean

If you have an experience about the solidedge could you give me help?

Link to post
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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.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
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.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
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
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 post
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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.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
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
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 post
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 post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...