For me, I use both .HKPs and Automation. Automation is good and easy to use, there is no long-learn curve there,but have limited API and seems not so stable. Sometime I what things be done without Expeditionpcb GUI, so I turn to .HKPs. Sometime may pepople prefer the openss of HKPs just loving freedom^_^
First reason is that we are still on 2005 and as library design is concerned it's better to stay on it for at least a year. Second, as mentioned above, is that automation API is not providing all the functionality of HKP (yet). I haven't used automation but I support the idea of providing users with access to CAD's internal functions. But at the same time there must be an export to human-readable format and it must export everything (it may be new XML-based format as extending current HKP format may be tricky, and this new format must be documented). Many things are easier, faster and better to do by processing text files, not by using automation.
Thank you both for replying - I hope to pick up some additional comments in time.
If you are both on 2005 then you are correct not everything that can be extracted from .hkp is available in Automation. If we are talking about 2007.3+ then I am hard pressed to think of something that's not available in Automation.
A comment was made about the stability of Automation: It's our experience that it is very stable - we are huge consumers of Automation so we tend to shake out all the issues internally. I won't say there are zero defects but there are very few. If you discover an Automation defect I would encourage you to submit it - we work very aggressively to fix these defects.
We use 2007.2. When I wanna output a DXF file from Expeditionpcb, I can't find how to control which items to output using API, I have to use a reply file, and it's not so stable.
' Get the application object
Set pcbApp = GetObject(,"MGCPCB.Application")
' Get the active document
Set pcbDoc = pcbApp.ActiveDocument
' License the document
' add a reference to the MGCPCB type library in order to use enums
' Invoke Idf Import dialog
' Get a reference to this dialog
Set dlgObj = pcbApp.Gui.FindDialog("General Interfaces")
' Create a replay file to fill out the controls in the form.
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.CreateTextFile("C:\Temp\FillDXF.l", True)
file.WriteLine("* Version 1.0: ")
file.WriteLine("c 0 32937")
file.WriteLine("c 0 32697")
file.WriteLine("n 0 16 102 0 1008 c Local: ZTEFabDataOutDXF_MM")
file.WriteLine("n 0 16 102 0 1 b 8")
file.WriteLine("a 0 1")
file.WriteLine("e 0 0 <22202567,220885370> 0 0 36592")
Private Function ValidateServer(doc)
dim key, licenseServer, licenseToken
' Ask Expedition document for the key
key = doc.Validate(0)
' Get license server
Set licenseServer = CreateObject("MGCPCBAutomationLicensing.Application")
' Ask the license server for the license token
licenseToken = licenseServer.GetToken(key)
' Release license server
Set licenseServer = nothing
' Turn off error messages. Validate may fail if the token is incorrect
On Error Resume Next
' Ask the document to validate the license token
If Err Then
ValidateServer = 0
ValidateServer = 1
Does automation already provides intreface to modify pinmapping data (and in general all that data in PDB)?
I see you are using the hidden, undocumented and unsupported, ReplayFile method on the document. There is a reason that it's hidden - it's designed for internal use, not for general use. :-)
If you want to drive the General Interfaces dialog there is an engine available in Automation Pro.
Pinmapping is readonly at this point in time. It's one of those few items that does not have a 'write' mechanism.
Yes, I used the undocumented menthod to control what items be outputed. I know there is the engines, but the difficulty is that we don't know how to control items be ouputed.
The methods on the General Interfaces object are described in the Automation Help document. Let me know if that is not sufficient and I will see if I can find you some additional information.
And will it have write method in the future?
Apparently it is available in the newly released 2007.5... So yes!
Well, then it may really worth looking into. Another question would be to interface Python with automation.
I have no experience with this but I believe using Python with Automation is possible. Python's win32.client package has support for COM. Also see the MakePy utility in this package.
I also believe that ActiveState (www.activestate.com) have excellent integration between their Python and the Microsoft .Net framework and COM.
I found this interesting thread and I have the same requirement like Yu Yanfeng: Export DXF with Automation.
So I took a look on the automation documentation in EE2007.5. In one point you're right meanwhile there are more export engines available through automation than in EE2005, but DXF export is still missing. Or better said: I was not able to find anything about how to modify the elements in the DXF export dialog. DXF export seems to be still the same like in 2005.
I have to admit that I don't have an AutomationPro license but I think the documentation is not depending on any licensed features. :-)