View Issue Details

IDProjectCategoryView StatusLast Update
0003311SketcherBugpublic2018-09-27 19:50
ReporterpaulleeAssigned Towmayer 
Status closedResolutionfixed 
PlatformFedora 27OSLinuxOS Version4.14.11-300.fc27
Product Version0.17 
Target Version0.18Fixed in Version0.18 
Summary0003311: SketchObjectPython - no addGeometry addConstraints setDriving...?
DescriptionForum discussion:-
SketchObjectPython - no addGeometry addConstraints setDriving...?

Following wmayer's example to add SketchObjectPython object

skf=SketchFeatureTemplate.SketchFeature(s) s.ViewObject.Proxy=0

It just works like sketch object and can edit and add lines, constraints etc.

But, it seems I can't work it like sketch object e.g. .addgeometry .addConstraints

Whilst with a sketch named 'sketch' typing "sketch." would return .addgeomtry .addConstraints .ConstraintsCount ...etc. (discussion post screen capture-1)

Typing s. return nothing above...see (discussion post screen capture-2)

# Sketcher Python Object 
import FreeCAD, FreeCADGui, Sketcher
App = FreeCAD
Gui = FreeCADGui

class SketchFeature:					# class SketcherClass: in wmayer's example
  def __init__(self, obj):
      obj.Proxy = self
  def execute(self, fp):
      FreeCAD.Console.PrintMessage("Execute completed before recompute ")
      fp.recompute()					# when used inside the execute() method of a custom feature class it invokes 
the method of the C++ base class
  def onChanged(self, fp, prop):
      '''Do something when a property has changed'''
      FreeCAD.Console.PrintMessage("Change property: " + str(prop) + "\n")
#  def __setstate__(self, state):
  def __setstate__(self, res):
#      self.object.setEditorMode("MapMode",1)	# Not OK
#      self.Object.setEditorMode("MapMode",1)	# Not OK
#      self.setEditorMode("Constraints",2)	# Not OK
      return None
Steps To ReproduceAs above
Additional InformationFreeCAD-0.17.git201801022222.glibc-x86_64.AppImage

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: None
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
TagsNo tags attached.



2018-01-15 00:08

reporter   ~0010766

DeepSOIC's comment...

"There appears to be a problem, that some methods are invisible if an object has extensions. I've seen missing methods on something else, and they are still there and callable, just not exposed by dir() or the autocomplete. Could you file a bug report?"


2018-09-27 19:50

administrator   ~0011863

Issue History

Date Modified Username Field Change
2018-01-15 00:07 paullee New Issue
2018-01-15 00:08 paullee Note Added: 0010766
2018-05-31 00:22 Kunda1 Target Version => 0.18
2018-09-27 11:52 wmayer Status new => confirmed
2018-09-27 19:50 wmayer Assigned To => wmayer
2018-09-27 19:50 wmayer Status confirmed => closed
2018-09-27 19:50 wmayer Resolution open => fixed
2018-09-27 19:50 wmayer Fixed in Version => 0.18
2018-09-27 19:50 wmayer Note Added: 0011863