In a macro I do many compares using "isEqual" and "isSame" to dynamic data. As a test, if I compare a Placement to itself using local data then all is fine but if I compare a placement to Dynamic data then Touched is set. For this post I don't care about the compare out-come, I have issues with Touched. This seems broken, doing a compare should not change the state of the model. Here is a test macro.
Code: Select all
tolerance = .0001
print(" First test --------------", App.activeDocument().isTouched())
for obj in App.activeDocument().Objects:
if obj.TypeId == "Sketcher::SketchObject":
if not hasattr(obj,"Copy_placement"): # add property
obj.addProperty("App::PropertyPlacement","Copy_placement")
obj.Copy_placement = obj.Placement # copy the placement
print("Found sketch")
print( App.activeDocument().isTouched())
# if obj.Placement.Base.isEqual(obj.Copy_placement.Base, tolerance):
# None
print( App.activeDocument().isTouched())
Thanks