import importXLSX
importXLSX.insert(u"C:/Users/Stephen/OneDrive/Documents/Documents/3D/Parts/TestSpreadsheet.xlsx","TankForList")
sheet = App.ActiveDocument.addObject("Spreadsheet::Sheet","MySpreadsheet")
cell = 0
for x in App.ActiveDocument.Objects:
cell = cell + 1
sheet.set("A" + str(cell), x.Label)
App.ActiveDocument.recompute()
I have written a macro to generate assemblies using 'Merge Project' & 'Placement' so the parts do not have 'A2plus' related spreadsheets.
In the above (Copied/pasted from other sources) line 2 can import a spreadsheet complete with data & formulae etc. for sorting
The remainder starts a blank spreadsheet and (with the aid of filters) lists the parts.
So far I have failed to list the parts to the imported spreadsheet (For sorting/processing)
Any ideas how to do this (or export parts list to an external spreadsheet)
OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)
Listing assemblies to spreadhees
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Listing assemblies to spreadhees
Hi
just for see examples macros work with spreadSheet :
Macro_FCTreeView
Macro_FCSpreadSheet_Extract
Macro_FCInfo
mario
just for see examples macros work with spreadSheet :
Macro_FCTreeView
Macro_FCSpreadSheet_Extract
Macro_FCInfo
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: Listing assemblies to spreadhees
Thanks. There was plenty to work from but could not find the one-liner that I thought might work. Finished up exporting the generated spreadsheet using the button on the spreadsheet workbench. This may be a manual fix but it gets you there. I can now set about merging spreadsheets for sorting/processing.
SDKenney
SDKenney