help on sheet metal script

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

shaise wrote: Sat Sep 22, 2018 5:39 pm
Some Improvements to Sheetmetal.py script attached.
Attachments
SheetMetalCmd.py
(29.98 KiB) Downloaded 51 times
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

Some Bug fix & New Command Sketch Based Wall [ Create Sketch on Face with Edge as reference as shown in the pic ]
sketch based wall.png
sketch based wall.png (29.7 KiB) Viewed 1557 times
inside thickness.png
inside thickness.png (3.84 KiB) Viewed 1557 times
Inside Outside.png
Inside Outside.png (4.13 KiB) Viewed 1557 times
Attachments
SheetMetalSketchCmd.py
(19.49 KiB) Downloaded 56 times
SheetMetalCmd.py
(30.35 KiB) Downloaded 54 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: help on sheet metal script

Post by Kunda1 »

jaisejames wrote: Fri Oct 05, 2018 12:45 pm Some Bug fix & New Command Sketch Based Wall [ Create Sketch on Face with Edge as reference as shown in the pic ]
Just wondering if you'd be interested in using git in your development process to show your development (and possibly inspire others to contribue) ?
You can read more about this at: Github
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
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: help on sheet metal script

Post by easyw-fc »

ulrich1a wrote: Sun Sep 23, 2018 1:49 pm I did experiment with the new features to create drawings. Exporting the Visgroups into a DXF-file is no problem. It turns out, that it is difficult to put the bendlabels into a Techdraw drawing. The bendlabels are Draft-text. The bendlabels can be put into a Techdraw drawing by inserting a DraftView. But they need to be aligned manually, which is only possible, when the are inserted as last element into the Drawing. And it is tedious, because the labels do not move with the mouse, but show only up at the correct position after updating the drawing view by scaling it.

It looks like, there is some tweaking necessary.

Ulrich
You may consider to add 'Annotations' in TechDraw instead of Draft-text.
Annotations can be placed with coding and moved later with the mouse.
from this thread
https://forum.freecadweb.org/viewtopic. ... 78#p261662

Code: Select all

#https://forum.freecadweb.org/viewtopic.php?f=22&t=31478&p=261679
#bestfit.py
templateFile = App.getResourceDir() + "Mod/TechDraw/Templates/A3_Landscape_ISO7200TD.svg"
for obj in FreeCAD.ActiveDocument.Objects:
    #for each part, techdraw 1 drawing with 3 views
    page = FreeCAD.ActiveDocument.addObject('TechDraw::DrawPage','page')
    page.Label=obj.Label
    
    template = FreeCAD.ActiveDocument.addObject('TechDraw::DrawSVGTemplate','Template')
    template.Template = templateFile
    page.Template = template
    page.ViewObject.show()

    featName = obj.Name
    feat = FreeCAD.ActiveDocument.getObject(featName)

    #first view
    view = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
    rc = page.addView(view)

    view.Source = [feat]
    view.Direction = (0.0,0.0,1.0)
    view.Scale = (3.0)
    view.X = 225
    view.Y =150.0

    FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewAnnotation','Annotation')
    FreeCAD.ActiveDocument.page.addView(App.activeDocument().Annotation)
    FreeCAD.ActiveDocument.getObject("Annotation").Text = [u"My note", ]
    FreeCAD.ActiveDocument.getObject("Annotation").X = 172.0
    FreeCAD.ActiveDocument.getObject("Annotation").Y = 161.0
    FreeCAD.ActiveDocument.recompute()
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: help on sheet metal script

Post by ulrich1a »

easyw-fc wrote: Thu Oct 11, 2018 8:09 pm You may consider to add 'Annotations' in TechDraw instead of Draft-text.
Annotations can be placed with coding and moved later with the mouse.
I made this Draft-text objects in order to correlate bend lines in the automatically created unbend object with the automatically created bend table in a spreadsheet. Ideally both objects could be used to create a TechDraw page. The Draft-text objects could be exported in a DXF-file, if the fix for this would be done properly. It worked for me, with the applied fix in the DXF exporter. The whole point is, you can create easily a drawing in LibreCAD from the exported DXF. But it is not possible to create a proper drawing from the same objects in TechDraw due to current limitations. See here: https://forum.freecadweb.org/viewtopic. ... 21#p259192

Ulrich
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: help on sheet metal script

Post by UR_ »

jaisejames wrote: Fri Oct 05, 2018 12:45 pm Some Bug fix & New Command Sketch Based Wall
Are there any news on merging this :?:

Can't find something on Github :(
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

sheetmetal with auto mitering added
sheetmetal_auto_mitering.png
sheetmetal_auto_mitering.png (36.32 KiB) Viewed 1432 times
Attachments
SheetMetalCmd.py
(36.83 KiB) Downloaded 52 times
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

sheetmetal_auto_mitering2.png
sheetmetal_auto_mitering2.png (45.08 KiB) Viewed 1431 times
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: help on sheet metal script

Post by shaise »

jaisejames wrote: Fri Oct 26, 2018 6:57 am sheetmetal with auto mitering added
As Kunda1 mentioned, can you use git to fork from https://github.com/shaise/FreeCAD_SheetMetal
It will be much easier to merge your changes, which are very good features.

shai
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: help on sheet metal script

Post by jaisejames »

I need to learn git. I will try.
Post Reply