New Macro " Sketch Constraint From Spreadsheet"

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
2cv001
Posts: 484
Joined: Wed Jan 01, 2020 9:30 am

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by 2cv001 »

I try with a Link Daily version (with code with accents)

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 2023.131.26244 +5365 (Git)
Build type: Release
Branch: LinkDaily
Hash: 73c4ca254c5de8849d104973482e98399fb24863
Python version: 3.8.10
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.6.2
Locale: French/France (fr_FR)
And it is OK !!!!
But when I go back to the version 0.21 it does not work

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32258 (Git)
Build type: Release
Branch: master
Hash: 0f4acc55beb66dcc9dfab442344c6286d6a2913e
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: French/France (fr_FR)
Installed mods: 
  * Assembly3 0.11.4
  * Curves 0.6.5
  * fasteners 0.4.26
  * Help 1.0.3
  * ThreadProfile 1.84.0
For exemple, if I tried to uninstall the macro I had this message.
Capture.PNG
Capture.PNG (20.78 KiB) Viewed 1730 times
It show an issue in filename(s)

Uninstall with daily version is ok.


:?: :?:
Macro Sketch Constraint From Spreadsheet :
https://wiki.freecad.org/Macro_Sketch_C ... adsheet/fr
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by chennes »

Yes, I'm sorry for the trouble, the fault is mine (and nothing to do with accents or anything like that). I refactored a chunk of the Addon Manager a couple of weeks ago and broke Macro installation. I have not yet had time to track down the source of the error, and it will be at least until the end of the day today before I can begin looking at it.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by chennes »

OK, I believe that I have fixed this in https://github.com/FreeCAD/FreeCAD/pull/9018 -- it's been merged, so if you are self-compiled the latest source code should include the fix. Note that you'll have to click the "Update cache" button in the Addon Manager before testing an install.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
2cv001
Posts: 484
Joined: Wed Jan 01, 2020 9:30 am

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by 2cv001 »

chennes wrote: Fri Mar 24, 2023 2:52 am - it's been merged, so if you are self-compiled the latest source code should include the fix.
Thanks @chennes!
I do not compile FreeCAD so I will wait for a new version. Do you know when a version pre-compiled will be available ? I don't know the steps between the moment a code is changed and the moment it is operational in the different versions of FreeCAD
It is not a problem for me, to wait. The important thing is that the problem is fixed so that those who want to recover a macro will be able to do so.

Thanks again chennes for your work !
Macro Sketch Constraint From Spreadsheet :
https://wiki.freecad.org/Macro_Sketch_C ... adsheet/fr
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by Syres »

2cv001 wrote: Fri Mar 24, 2023 5:41 am
chennes wrote: Fri Mar 24, 2023 2:52 am - it's been merged, so if you are self-compiled the latest source code should include the fix.
Thanks again chennes for your work !
The AddonManager fix works fine but this has highlighted that the line

Code: Select all

 __icon__    = "https://wiki.freecad.org/File:SketchConstraintFromSpreadsheet.svg"
requires changing to :

Code: Select all

__icon__    = "https://wiki.freecad.org/Images/1/15/Macro_Sketch_Constraint_From_Spreadsheet.svg"
as at present this is output in the Report View:

Code: Select all

09:53:36  Cannot use specified icon for Sketch Constraint From Spreadsheet, https://wiki.freecad.org/File:SketchConstraintFromSpreadsheet.svg is not a direct download link
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by chennes »

Yeah, lots of macro authors made that mistake, because on the Wiki itself if you use one of those File: links it will show your image, but that link is really to a wiki page about the image. I actually have code that fixes it when scraping the wiki page for the icon, so I'm surprised that it isn't fixing the link it's getting from the code. I'll take a look.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
2cv001
Posts: 484
Joined: Wed Jan 01, 2020 9:30 am

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by 2cv001 »

chennes wrote: Fri Mar 24, 2023 2:26 pm I actually have code that fixes it when scraping the wiki page for the icon, so I'm surprised that it isn't fixing the link it's getting from the code. I'll take a look.
Ok, so for now, i'm not doing the changes Syres suggested to allow you to test. I'll do it later. Is that right?
Macro Sketch Constraint From Spreadsheet :
https://wiki.freecad.org/Macro_Sketch_C ... adsheet/fr
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by chennes »

You can make the changes, that's fine, I'll test it with a unit test.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
2cv001
Posts: 484
Joined: Wed Jan 01, 2020 9:30 am

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by 2cv001 »

Syres wrote: Fri Mar 24, 2023 10:04 am

Code: Select all

__icon__    = "https://wiki.freecad.org/Images/1/15/Macro_Sketch_Constraint_From_Spreadsheet.svg"
Done.
Thanks !

Edit 25/02/2023
@chennes @Syres
I changed, but at this time, same issue.
So in code, I have now :

Code: Select all

__date__    = "2023/03/23"    #YYYY/MM/DD
__version__ = __date__
__icon__    = "https://wiki.freecad.org/Images/1/15/Macro_Sketch_Constraint_From_Spreadsheet.svg"
__Wiki__    = "https://wiki.freecad.org/Macro_sketchConstraintFromSpreadsheet"
and in the wiki, I did the same change :

Code: Select all

{{Macro
|Name=Macro Sketch Constraint From Spreadsheet
|Description=Macro which, with a simple click on a spreadsheet cell, adds a length constraint to a line or between 2 points using a spreadsheet cell alias or address (ex. C2). Macro can create alias for you.
|Author=2cv001
|Download=[https://wiki.freecad.org/Images/1/15/Macro_Sketch_Constraint_From_Spreadsheet.svg ToolBar icon]
|Version=00.03
|Date=2023-03-24
|FCVersion=All
}}
Is it ok ?

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32258 (Git)
Build type: Release
Branch: master
Hash: 0f4acc55beb66dcc9dfab442344c6286d6a2913e
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: French/France (fr_FR)
Installed mods: 
  * Assembly3 0.11.4
  * Curves 0.6.5
  * fasteners 0.4.26
  * Help 1.0.3
  * ThreadProfile 1.84.0
Attachments
Capture.PNG
Capture.PNG (60.7 KiB) Viewed 1449 times
Macro Sketch Constraint From Spreadsheet :
https://wiki.freecad.org/Macro_Sketch_C ... adsheet/fr
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: New Macro " Sketch Constraint From Spreadsheet"

Post by mario52 »

Hi

i think the problem is after the change freecad to freecadweb

AddonManager search always to freecadweb and the image in to freecad

page web

Code: Select all

https://wiki.freecad.org/Macro_crank_simul
icon path

Code: Select all

https://wiki.freecad.org/images/0/04/Macro_crank_simul.png
icon searched by AddonManager

Code: Select all

15:20:14  Attempting to fetch macro icon from https://www.freecadweb.org/wiki/images/0/04/Macro_crank_simul.png
but certain wiki page hare freecad.org (as my example) other freecadweb.org

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.
Post Reply