klionon.blogg.se

Python freecad examples
Python freecad examples






python freecad examples
  1. #PYTHON FREECAD EXAMPLES SOFTWARE#
  2. #PYTHON FREECAD EXAMPLES CODE#

If hasattr(o, "Proxy") and o.Proxy is not None and o.Proxy.Type = "FemMaterialMechanicalNonlinear" and o.LinearBaseMaterial = lin_mat_obj:į(o.Name + ' is based on the selected material: ' + lin_mat_obj.Name + '.

python freecad examples

# check if an nonlinear material exists which is based on the selected material already If len(sel) = 1 and sel.isDerivedFrom("App::MaterialObjectPython"): ViewProviderConstraintAreaObject(a.ViewObject)įreeCADGui.activeDocument().getObject(a.Name).ShapeColor = layerColorįreeCADGui.activeDocument().getObject(a.Name).Transparency = layerTransparentįreeCADGui.activeDocument().getObject(a.Name).DisplayMode = 1į("No PCB found\n") LayerTransparent = PCBconstraintAreasĪ = ("Part::FeaturePython", typeCA + "_".format(0)) LayerColor = (PCBconstraintAreas / 255., PCBconstraintAreas / 255., PCBconstraintAreas / 255.) If i.isDerivedFrom("Sketcher::SketchObject") and i.Shape.isClosed(): If len(zaznaczoneObiekty) and getPCBheight(): Solver_object.GeometricalNonlinearity = "nonlinear" Solver_object.MaterialNonlinearity = "nonlinear" Print('Set MaterialNonlinearity and GeometricalNonlinearity to nonlinear for ' + solver_object.Label) If hasattr(solver_object, "Proxy") and (solver_ = 'Fem::FemSolverCalculixCcxTools' or solver_ = 'Fem::FemSolverObjectCalculix'): # set solver attribute for nonlinearity for ccxtools CalculiX solver or new frame work CalculiX solver # we do not change attributes if we have more than one solver, since we do not know which one to take If m.isDerivedFrom('Fem::FemSolverObjectPython'):

python freecad examples

# nonlinear geometry -> it is triggered anyway # set some property of the solver to nonlinear (only if one solver is available and if this solver is a CalculiX solver): String_lin_mat_obj = "('" + + "')"Ĭommand_to_run = "FemGui.getActiveAnalysis().addObject(ObjectsFem.makeMaterialMechanicalNonlinear(FreeCAD.ActiveDocument, " + string_lin_mat_obj + "))"į("Create FemMaterialMechanicalNonlinear") acker = DraftTrackers.boxTracker()į(callback=self.getPoint,movecallback=self.update,extradlg=self.taskbox()) Sel = ()į(str(translate("Arch","Create Panel")))įreeCADGui.doCommand("Arch.makePanel(FreeCAD.ActiveDocument." + obj.Name + ",thickness=" + str(self.Thickness) + ")")į() Self.FORMAT = "%." + str(self.DECIMALS) + "f mm" Self.DECIMALS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals",2) Self.Thickness = p.GetFloat("PanelThickness",10) Self.Width = p.GetFloat("PanelWidth",1000) Self.Length = p.GetFloat("PanelLength",1000) P = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch") You can rate examples to help us improve the quality of examples. These are the top rated real world Python examples of FreeCADGui extracted from open source projects. Python FreeCADGui is part of the FreeCAD package library. When the user clicks on the menu item, the "Activated()" function is executed.

#PYTHON FREECAD EXAMPLES CODE#

This code defines a custom command called "M圜ommand" with an icon, menu text, and tooltip. When the user clicks on the button, the "m圜ommand()" function is executed.įreeCADGui.addCommand('m圜ommand', M圜ommand()) This code creates a custom toolbar named "MyToolbar" and adds a button to it. Toolbar = FreeCADGui.createToolbar("MyToolbar")īutton = toolbar.addItem("Path/To/Icon", "MyButton", "My command") This code displays a message box with the text "Hello World!". Here are some examples of code using Python FreeCADGui: With it, developers can create custom tools and commands for FreeCAD that enhance the user experience.

#PYTHON FREECAD EXAMPLES SOFTWARE#

Python FreeCADGui is a module of the FreeCAD software that allows for the creation of graphical user interfaces (GUI) for interactive modeling and design.








Python freecad examples