FreeCAD Nodes (renamed from fc_nodes)

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
j8sr0230
Posts: 140
Joined: Thu Apr 07, 2022 8:59 am
Location: Chemnitz
Contact:

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by j8sr0230 »

Here's another great combined application of the new nodes, using a slider to move an object along a trajectory and align it normal to the surface.
Align shape on surface
Align shape on surface
nodes_align_shape_on_srf.gif (651.34 KiB) Viewed 3559 times
Codelink on GitHub: https://github.com/j8sr0230/codelink
Codelink on PiPy: https://pypi.org/project/codelink/
FreeCAD Nodes Workbench on GitHub: https://github.com/j8sr0230/Nodes
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by Kunda1 »

This is one of my favorite threads ATM...it's magic each time it's updated
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
drmacro
Veteran
Posts: 8867
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by drmacro »

I created a couple node diagrams yesterday.

Used the File>Save menu to save them.

But, they saved with no extension and the File>Open doesn't see them.

I tried a couple extensions (grph, gph, ...) but, still not found.

The files I named are there, just without any extension.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by MisterMaker »

I got a json extension. Maybe we can dump it in the freecad file and add a export/import node function?
User avatar
j8sr0230
Posts: 140
Joined: Thu Apr 07, 2022 8:59 am
Location: Chemnitz
Contact:

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by j8sr0230 »

drmacro wrote: Wed Nov 30, 2022 8:08 pm I created a couple node diagrams yesterday.

Used the File>Save menu to save them.

But, they saved with no extension and the File>Open doesn't see them.

I tried a couple extensions (grph, gph, ...) but, still not found.

The files I named are there, just without any extension.
Thanks for your report!. Actually, the files should be automatically saved as JSON files. Can you open them when you append *.json to your files?
Codelink on GitHub: https://github.com/j8sr0230/codelink
Codelink on PiPy: https://pypi.org/project/codelink/
FreeCAD Nodes Workbench on GitHub: https://github.com/j8sr0230/Nodes
User avatar
j8sr0230
Posts: 140
Joined: Thu Apr 07, 2022 8:59 am
Location: Chemnitz
Contact:

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by j8sr0230 »

MisterMaker wrote: Wed Nov 30, 2022 8:34 pm I got a json extension. Maybe we can dump it in the freecad file and add a export/import node function?
Thanks for the idea. I know that microelly2 has saved the node graphs of his PyFlow node editor version in the FreeCAD file. I will check this and take a look at the *.FCStd format.
Codelink on GitHub: https://github.com/j8sr0230/codelink
Codelink on PiPy: https://pypi.org/project/codelink/
FreeCAD Nodes Workbench on GitHub: https://github.com/j8sr0230/Nodes
User avatar
j8sr0230
Posts: 140
Joined: Thu Apr 07, 2022 8:59 am
Location: Chemnitz
Contact:

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by j8sr0230 »

Kunda1 wrote: Tue Nov 29, 2022 3:22 pm This is one of my favorite threads ATM...it's magic each time it's updated
Thanks for the flowers! I do my best to continue to meet the high expectations :D As slowly but surely more and more users discover FreeCAD Nodes, I should probably shift my priorities from node development towards project organization, junior staff recruitment, quality assurance and node documentation. Am curious where the journey goes ;)
Codelink on GitHub: https://github.com/j8sr0230/codelink
Codelink on PiPy: https://pypi.org/project/codelink/
FreeCAD Nodes Workbench on GitHub: https://github.com/j8sr0230/Nodes
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by Kunda1 »

j8sr0230 wrote: Wed Nov 30, 2022 9:50 pm Am curious where the journey goes ;)
Onward!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
drmacro
Veteran
Posts: 8867
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by drmacro »

j8sr0230 wrote: Wed Nov 30, 2022 9:30 pm ...
Thanks for your report!. Actually, the files should be automatically saved as JSON files. Can you open them when you append *.json to your files?
Note below that Help>About shows Nodes 0.1.23, but Addon manager says 0.0.19, up to date.
  • adding the .json extension allows the File>Open dialog to see the file.
  • the File>Save dialog does no add .json
Loading the file produces the following:

Code: Select all

10:36:17  Traceback (most recent call last):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 397, in deserialize
    new_node = self.getNodeClassFromData(node_data)(self)
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./nodes/viz/viz_compound_viewer.py", line 46, in __init__
    self.fc_obj = App.ActiveDocument.addObject("Part::Feature", "CViewer")
10:36:17  AttributeError: 'NoneType' object has no attribute 'addObject'
10:36:17  Traceback (most recent call last):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 397, in deserialize
    new_node = self.getNodeClassFromData(node_data)(self)
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 360, in getNodeClassFromData
    return Node if self.node_class_selector is None else self.node_class_selector(data)
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_sub_window.py", line 50, in get_node_class_from_data
    return NodesStore.get_class_from_opcode(data['op_code'])
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_conf.py", line 44, in get_class_from_opcode
    raise OpCodeNotRegistered("OpCode '%d' is not registered" % op_code)
10:36:17  TypeError: %d format: a number is required, not str
10:36:17  Traceback (most recent call last):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 397, in deserialize
    new_node = self.getNodeClassFromData(node_data)(self)
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./nodes/viz/viz_compound_viewer.py", line 46, in __init__
    self.fc_obj = App.ActiveDocument.addObject("Part::Feature", "CViewer")
10:36:17  AttributeError: 'NoneType' object has no attribute 'addObject'
10:36:17  Traceback (most recent call last):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 327, in loadFromFile
    self.deserialize(data)
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 435, in deserialize
    new_edge = Edge(self).deserialize(edge_data, hashmap, restore_id, *args, **kwargs)
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_edge.py", line 301, in deserialize
    self.end_socket = hashmap[data['end']]
10:36:17  KeyError: 140059223251648
10:36:17  Traceback (most recent call last):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_default_node.py", line 297, in eval
    return self.eval_primer()[index]
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_default_node.py", line 338, in eval_primer
    self.markDescendantsDirty()
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 345, in markDescendantsDirty
    for other_node in self.getChildrenNodes():
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 414, in getChildrenNodes
    other_node = edge.getOtherSocket(self.outputs[ix]).node
10:36:17  AttributeError: 'NoneType' object has no attribute 'node'
10:36:17  
During handling of the above exception, another exception occurred:

10:36:17  Traceback (most recent call last):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_window.py", line 137, in onFileOpen
    if nodeeditor.fileLoad(file_name):
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_sub_window.py", line 63, in fileLoad
    self.do_eval_outputs()
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_sub_window.py", line 56, in do_eval_outputs
    node.eval()
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_default_node.py", line 302, in eval
    self.markDescendantsDirty()
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 345, in markDescendantsDirty
    for other_node in self.getChildrenNodes():
10:36:17    File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 414, in getChildrenNodes
    other_node = edge.getOtherSocket(self.outputs[ix]).node
10:36:17  AttributeError: 'NoneType' object has no attribute 'node'
10:36:17  
I have attached the file below (I just renamed it to .zip, it is not zipped)

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (XFCE/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.21.31162 (Git)
Build type: Release
Branch: master
Hash: cc8a30929abd67a77684a855f2741d9ff91d993e
Python 3.9.2, Qt 5.15.2, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.1
Locale: English/United States (en_US)
Installed mods: 
  * parts_library
  * kicadStepUpMod 10.16.5
  * Manipulator 1.4.9
  * PrefExtras
  * QuickMeasure 2022.10.28
  * MyDefaults 2022.9.15
  * ZolkoBase 0.0.1
  * DynamicData 2.46.0
  * fasteners 0.4.24
  * Nodes 0.1.23
  * MacMechX 2022.9.15
  * ExtremeProDark 2.6.4
  * ProDarkThemePreferencePack 1.0.0
  * fcgear 1.0.0
  * plugins
  * Pyramids-and-Polyhedrons
  * Defeaturing 1.2.0
  * Assembly4 0.12.4
  * BaseTest 0.0.1
  * OpticsWorkbench 1.0.9
  * workfeature-macro
  * sheetmetal 0.2.59
  * A2plus 0.4.60e
  * CurvedShapes 1.0.4
  * BasicMech 0.0.1
  * Dracula 0.0.2
  * Curves 0.6.4
  * workfeature
  * lattice2 1.0.0
Attachments
BuildArray_json.zip
(24.69 KiB) Downloaded 46 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: FreeCAD Nodes (renamed from fc_nodes)

Post by flachyjoe »

j8sr0230 wrote: Wed Nov 30, 2022 9:39 pm Thanks for the idea. I know that microelly2 has saved the node graphs of his PyFlow node editor version in the FreeCAD file. I will check this and take a look at the *.FCStd format.
I also used a FC object to store a file, see https://github.com/FlachyJoe/FCPDWorkbe ... ude.py#L93
NB : file is open in an external app, it will be easier in your case.
- Flachy Joe -
Image
Post Reply