Hi All,
Should be an easy question for someone
Can I access the title value of a parts list already place on a sheet within an IDW?
I am familiar with setting the value using
Dim oPartList As PartsList
Set oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
oPartsList.Title="XXX"
but I want to read it into a variable to use as the file name for exporting to excel
Thanks in advance
Mark
Inventor 2021
Solved! Go to Solution.
Solved by dalton98. Go to Solution.
Solved by petr.meduna. Go to Solution.
Hi,
property Title is Read/Write so you can save it into a variable.
Dim doc As DrawingDocument = ThisApplication.ActiveDocument Dim pl As PartsList = doc.ActiveSheet.PartsLists.Item(1) Dim oTitle As String = pl.Title Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap oOptions.Value("StartingCell") = "A1" oOptions.Value("IncludeTitle") = True oOptions.Value("AutoFitColumnWidth") = True Dim oName As String = "C:\TEMP\" & ThisDoc.FileName(False) & "_" & oTitle & ".xlsx" pl.Export(oName, PartsListFileFormatEnum.kMicrosoftExcel, oOptions)
oDrawDoc = ThisApplication.ActiveDocument Dim oPartList As PartsList oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1) oListName = oPartList.ReferencedDocumentDescriptor.DisplayName MessageBox.Show(oListName) oExport = Left(oListName, oListName.Length - 4) MessageBox.Show(oExport)
Hi Petr,
Thanks very much for your solution
I guess that is in ilogic but I can convert it to vba easily enough
Regards
Mark
Thanks Dalton,
That helps and also solves another part of my code which is to extract the referenced assembly document
Regards
Mark
Can't find what you're looking for? Ask the community or share your knowledge.