Ask Lemmy
A Fediverse community for open-ended, thought provoking questions
Rules: (interactive)
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com.
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.
6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online
Reminder: The terms of service apply here too.
Partnered Communities:
Logo design credit goes to: tubbadu
view the rest of the comments
They have what looks like documentation. That manual is out of date and incomplete.
FreeCAD exposes a Python console as an end-user feature. It has a macro recording system for automating repetitive tasks, much like MS Office does, it uses Python as a scripting language. Can you show me an API reference for this feature?
I want to write a macro that will insert some text into the cell of a spreadsheet I have selected. Click a cell, click the macro button, and it puts some text into that cell. It can do this. There are macros published that do this kind of thing. Show me where in their published documentation the functions necessary to do that are described.
They don't help people in that forum. For some reason, FreeCAD's forums default to English, but no one in the community speaks English as a first langauge. So you ask a detailed technical question, and some French guy babelfishes a couple of the key words and posts a random paragraph about the workbench you mentioned and a random unrelated code snippet. I've paid to have someone help me work on this software, that went nowhere.
kagis
https://freecad.github.io/SourceDoc/modules.html
I don't use FreeCAD, don't have any familiarity with this spreadsheet functionality, but let's look.
kagis
They appear to have a Doxygen API reference for their spreadsheets here:
https://freecad.github.io/SourceDoc/d0/da8/classSpreadsheet_1_1Sheet.html
setCell()
looks like it sets a cell value to me.That appears to take a CellAddress, which it looks like is obtained via
getCellAddress()
. As I said, I haven't used FreeCAD's spreadsheets, but I expect that it has some cell-addressing syntax akin to spreadsheets that I've used, and that one passes the name in to that, same as one would if referencing the cell in a formula to compute another cell's value. I've no idea if FreeCAD's syntax is the same as Excel's, or if it differs, though, and I'm not going to look that up; that shouldn't be an API-specific issue.It also looks like it has a macro-recording feature. It looks like, to my quick skim, that natively generates Python:
https://wiki.freecad.org/Macros
And looking at the source of an arbitrarily-chosen macro, it appears to be in Python, rather than some app-specific macro language:
https://wiki.freecad.org/Macro_Rotate_View
So I expect that you can most-likely just record yourself performing the operation and the macro-recording functionality will give you the code without you needing to write something.
EDIT: It sounds like you want to get the selected cells rather than specifying the to-be-modified cell by name, which it looks like
SheetTableView::selectedRanges()
provides you with; Range objects appear to provide for a selection including many cells, but if you only want, say, the starting cell (which would presumably be the case for a single cell selection), then it looks likeRange::from()
provides that, since the starting cell would be the same cell as the only cell in a selection if there's a single-cell selection. That returns a CellAddress as well.