For that I'm writing a script that show or hide all the LCS in the Asm4 assembly.
If the LCS is in a Part inside the Asm4 document I have not problem for to toogle its visibility but if the LCS is in a Part in a separate file I don't know how to access it.
My first code is:
Code: Select all
import FreeCAD
objectList = FreeCAD.ActiveDocument.Objects
print (len(objectList))
for obj in objectList:
name = obj.Name
if (obj.TypeId == "PartDesign::CoordinateSystem"):
print("This is a LCS")
FreeCADGui.ActiveDocument.getObject(name).Visibility = False
elif (obj.TypeId == "App::Link"):
print("This is a Link ", name)
linked = obj.getLinkedObject()
print ("Linked Name = ",linked.Name)
host = FreeCADGui.ActiveDocument.getObject(linked.Name)
print ("The Host is ",host)
Code: Select all
This is a Link Master_Sketckers001
Linked Name = Master_Sketckers
The Host is <View provider object at 0000025262BAAE10>
Code: Select all
This is a Link Soporte_Cama_1
Linked Name = Soporte_Cama
The Host is None