Sketcher SketchObject, или формално Sketcher::SketchObject, е основен елемент за създаване на 2D обекти с Работна маса Sketcher.
Sketcher::SketchObject произхожда от Part Part2DObject, което означава, че това е обект от тип Part Feature, специализиран за 2D геометрия. Подобно на Part2DObject, SketchObject може да бъде прикрепен към равнини и лица. В допълнение, SketchObject може да се снабди с геометрични ограничения.
Опростена диаграма на връзките между основните обекти във FreeCAD
Вижте Sketcher NewSketch.
Вижте Свойство за всички типове свойства, които могат да имат скриптови обекти.
Класът Sketcher SketchObject (Sketcher::SketchObject) е получен от класа Part Part2DObject (Part:Part2DObject) и наследява всички негови свойства.
Sketcher SketchObject има също следните допълнителни свойства в Преглед на свойствата. Скритите свойства могат да бъдат показани с помощта на командата Show hidden в контекстното меню на Преглед на свойствата.
Основа
PartShape): TBD.Internal Geometry
Bool): ако е истина, вътрешните лица са генерирани въз основа на ръбовете в скицата. Тези лица могат да бъдат избрани като затворени профили за операции. introduced in 1.0Sketch
GeometryList): списък на геометрични елементи за Част, които съществуват вътре в скицата.[].LinkSubList): списък на геометрични елементи за Част извън тази скица, които се използват за справка.IntegerList): sketch external geometry type: 0 (projection), 1 (intersection) or 2 (both). introduced in 1.1Bool): if true the sketch is fully constrained.LinkListHidden): sketch export geometry.GeometryList): sketch external geometry.Precision): tolerance for fitting arcs of projected external geometry.Auto Constraints
Bool): if true constraints are automatically added when creating geometry or (introduced in 26.3) proposed when dragging existing points.Bool): if true redundant auto-constraints are avoided.Grid
Bool): if true the grid is resized based on the boundingbox of the geometry of the sketch.Length): the size of the spacing of the local grid lines in the 3D View; it defaults to 10 mm.Bool): if true a grid local to the object will be displayed in the 3D View. This grid is independent of the Draft Grid.Layers
BadType):Object Style
Bool): if true the object will be colored based on user preferences, introduced in 1.1: the ВидLine Color, ВидPoint Color and ВидShape Appearance properties are then hidden in the Property View. Set to false to specify colors explicitly.Visibility automation
String): name of the workbench to activate when editing the sketch; it defaults to SketcherWorkbench.Bool): if true the camera will be forced to orthographic view mode when the sketch is opened.Bool): if true all objects that depend on the sketch are hidden when the sketch is opened.Bool): if true the camera position is saved before opening the sketch, and is restored after closing it.Bool): if true only (parts of) objects behind the sketch plane are visible while the sketch is being edited.Bool): if true all objects used in links to external geometry are shown when the sketch is opened.Bool): if true all objects this sketch is attached to are shown when the sketch is opened.PythonObject): a custom class associated with this object, that handles hiding and showing other objects when opening and closing the sketch.See also: FreeCAD Scripting Basics and scripted objects.
See Part Feature for the general information on adding objects to the document.
A SketchObject is created with the addObject() method of the document.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("Sketcher::SketchObject", "Sketch")
obj.Label = "Custom label"
For Python subclassing you should create the Sketcher::SketchObjectPython object.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("Sketcher::SketchObjectPython", "CustomSketch")
obj.Label = "Custom label"