Howdy all y'all!
I'm very much a beginner with automation , .net, VB, efm, vbs. I figured this may be an easier task to start with. I'd like to get the heights for each part and tie to variable or write out to a text file then do something else with it later. I found the PCB Automation Model 7.9.4. I'm thinking I need to "call" one of these objects.properties to get the data? Maybe Component>FindProperty?
So have been throwing some things together below but definitely know I'm missing a lot. Trying to use a message box now to test but will/can swap this out with some code to write to text instead. Looking for any help with direction or maybe start over :-)
'Add any typ libraries to be used.
' Get the Application object
'Set pcbAppObj = Application
'On error resume next
'Set pcbAppObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")
'If (Err) then
'If won't open in Expedition try Planner
Set pcbAppObj = GetObject(,"MGCPCB.Application")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set compheightfile = filesys.CreateTextFile("./compmaxheights.txt", True)
' Get the active document
Set pcbDocObj = pcbAppObj.ActiveDocument
' License the document
'Get the parts collection
Dim partsColl: Set partsColl = pcbDocObj.Parts
Dim i, j
compmaxheightinfo = "Height (mils): " & vbCRLF & refDes & vbTab & Height & vbCRLF & vbCRLF & "Height (mils): "_
& vbCRLF & refDes & vbTab & Height & vbCRLF'vbCRLF & vbCRLF_
'& "Height (mils): " & vbCRLF & refDes & vbTab & Height & vbCRLF
'msgbox compheightinfo '"Height: " & vbCRLF & refDes & ", " & Height & " mils" & vbCRLF & vbCRLF_
'& "Height: " &vbCRLF & refDes& ", " & " mils"