Launch Non-FreeCAD Files

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Launch Non-FreeCAD Files

Post by chrisb »

rich61 wrote: Mon Mar 13, 2023 8:50 pm And GeneFC, I guess this function could default to off in the preferences. Since it would use the OS command line, I don't see where it would create so many problems. Any problems are in the OS app, once launched to the OS command line, FC is out of the picture.
Maybe, but that wouldn't reduce the noise.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
rich61
Posts: 156
Joined: Sat Jul 20, 2019 9:56 am

Re: Launch Non-FreeCAD Files

Post by rich61 »

I think the strongest objection I hear is that FC isn't a project manager. My argument is that a full project manager isn't required to offer a nice feature, just a list of links.

In the firefox browser I can type "file:///home/rich/FileName.pdf" and Firefox launches the associated PDF app at the OS level, probably on every popular OS, based on the file name and extension.

Another avenue is this:

Using the existing text document in FC, allow links to local disk path, and also internet paths.

I guess it still would have to launch a file open operation at the system level or the system's browser.

Also, the python subprocess function works on all OS that support python.

I think this idea has been fleshed out enough.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Launch Non-FreeCAD Files

Post by onekk »

rich61 wrote: Mon Mar 13, 2023 10:15 pm ...
Not exactly, you are probably not aware of the fact that each OS has is association system, to launch files.

What is very easy in your description, will work as example if you send your directory to another user that use maybe Linux and you have made you file in Windows or MacOS?

This is why in a multi OS perspective very often scripted solutions are used, when you make the "init part" or the "prepare project dir" target in my example, some magick will happpen to collect informations about OS and presence and location of programs.

Same things as example when making a container like a zipped file, the unzip program will take care of managing differences between OS as there is an intermediate firmat that is OS agnostic.

If you store file paths on FreeCAD your file will be usable only on your machine with the OS that has been used to create the file, except if you use some mechanics to store them in POSIX paths but as example FreeCAD is not yet totally "OS agnostic".

Some users when using multiple files and Links have complained about the fact that some paths should be adapted depending on OS used.

More generally what is easy in your mind has to be translated in code and mechanics that at least in actual development way should be consistent across three OS Linux, Windows and MacOS.

as example in Linux you could even have different shells and you could launch FreeCAD from a shell were the path could even be different from the system one, like when you are executing FreeCAD in a "conda install", so you could be in a situation where FreeCAD could reach system installed software.

Some mechanism to manage projects would be interesting as it is not a strange user case, but probably is not a task for FreeCAD, maybe for an associated project.

I have done the example of Sphinx used to make code documentation, as it is usable from what I remember on the three OS above mentioned plus probably some *BSD variants.

But even in the example it depends on external software, as example to literate some python code I had to install a bunch of Latex packages so it is not a "monkey task".

It is more like when in medieval culinary books some receipt start with "take a deer", some planning has to be made prior to decide what is on the menu today.

Sadly I could not be more aware of different ways as I don't own a MacOS and my Windows user cases are limited. I've used almost exclusively Linux from around 20 years.

Kind Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Launch Non-FreeCAD Files

Post by bambuko »

After reading your explanation (thank you!) @onekk I will continue with my simple, homegrown DIY project management scheme ;)

KISS rules :mrgreen: :mrgreen:

to be honest the only thing I really miss is the ability to add (and keep) comments (verbage) to anything inside the tree?
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Launch Non-FreeCAD Files

Post by onekk »

bambuko wrote: Tue Mar 14, 2023 10:48 am ...
to be honest the only thing I really miss is the ability to add (and keep) comments (verbage) to anything inside the tree?
This will probably more easy to do, or maybe on some extent is already done as some entitites have a Label2 property that probably could be used to place things that will not impact the Treeview.

What could be interesting and probably ease to add, is to have a "note" property that will be able to contain a RichTextEdit text (see Qt explanation) that could be maybe shown as a tooltip (probably adding some Preferences somewhere) so when you hover the treeview you could have these "comments" (say not more than 200 or 300 characters as html markup is using some space).

This way you could maybe add a description, with even maybe an "html link" that could be used to open a page in the "start Page" that from what I remember is managed by a QtWebsomething (Sorry but my memory is not helping).

I don't know how much coding time a similar thing could be done:

@wmayer er @yorik what do you think?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Bance
Veteran
Posts: 4186
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Launch Non-FreeCAD Files

Post by Bance »

bambuko wrote: Tue Mar 14, 2023 10:48 am the ability to add (and keep) comments (verbage) to anything inside the tree?
Have you looked at Label2?
Snip macro screenshot-6e2881.png
Snip macro screenshot-6e2881.png (79.65 KiB) Viewed 601 times
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Launch Non-FreeCAD Files

Post by onekk »

Bance wrote: Tue Mar 14, 2023 11:17 am ...
I have seen that the presence of Label2 is not generalized in all FreeCAD "documentObjects" as example "Solid primitives" have not a Label2 property.

EDIT: See below

Something similar could be done with code below that will add a "Notes" category with a "Note" field where you could put a text string, for a "Part WB" Cube named "Box":

Code: Select all

obj = FreeCAD.getDocument('Unnamed').getObject('Box')
obj.addProperty("App::PropertyString", "Notes", "Notes", "Note")
obj.Notes = "New Note"
It will be interesting if this could maybe be implemented with a "RichText" context and shown when hovering the element in the TreeView as a tooltip.

Regards

Carlo D.
Last edited by onekk on Tue Mar 14, 2023 12:16 pm, edited 1 time in total.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Launch Non-FreeCAD Files

Post by bambuko »

Bance wrote: Tue Mar 14, 2023 11:17 am Have you looked at Label2?
yes, and I use it a lot (where appropriate) :geek:

I had in mind more verbose "comments" on design intent behind the way something is done/designed,
so that when I come back to the project after a while, I can read rather than have to guess ;)

I have added text documents as well, and this is close to what I have in mind

@onekk
I like your idea of note property
Rich text would make my day ;)
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Launch Non-FreeCAD Files

Post by drmacro »

onekk wrote: Tue Mar 14, 2023 11:37 am ...
I have seen that the presence of Label2 is not generalized in all FreeCAD "documentObjects" as example "Solid primitives" have not a Label2 property.
...
Is this true?

Have you selected the object in the tree, gone to the Properties view, right click and select "Show all".
Attachments
Screenshot_20230314_080834.png
Screenshot_20230314_080834.png (63.26 KiB) Viewed 542 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Launch Non-FreeCAD Files

Post by onekk »

drmacro wrote: Tue Mar 14, 2023 12:05 pm ...
Have you selected the object in the tree, gone to the Properties view, right click and select "Show all".

No I haven't done this, amended above post, nice to know.

Sorry but I'm not a GUI user, I prefer to make thing using scripts, so. :oops:

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply