blackman12 Posted February 21, 2021 Posted February 21, 2021 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,
ahmet Posted February 21, 2021 Posted February 21, 2021 You should check for error after ObjGet like this $de = ObjGet("","SolidEdge.DraftDocument") If @error Then MsgBox(0,"Error from ObjGet","Error code:" & @error) Next your example from Excel uses GetObject(, "SolidEdge.Application") and the one from within AutoIt uses "SolidEdge.DraftDocument".
blackman12 Posted February 21, 2021 Author Posted February 21, 2021 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?
Danp2 Posted February 21, 2021 Posted February 21, 2021 That's 0x80020006 in hex. Search the forum for prior discussions. Latest Webdriver UDF Release Webdriver Wiki FAQs
blackman12 Posted February 21, 2021 Author Posted February 21, 2021 😕 Unfortunately, there is no info meaningly.
water Posted February 21, 2021 Posted February 21, 2021 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 2024-07-28 - Version 1.6.3.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 (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
water Posted February 21, 2021 Posted February 21, 2021 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 2024-07-28 - Version 1.6.3.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 (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
blackman12 Posted February 21, 2021 Author Posted February 21, 2021 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.
water Posted February 21, 2021 Posted February 21, 2021 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 2024-07-28 - Version 1.6.3.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 (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
LarsJ Posted February 22, 2021 Posted February 22, 2021 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. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
blackman12 Posted February 28, 2021 Author Posted February 28, 2021 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now