Problems using Part.makeCompound with ViewObject

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Mark Szlazak
Posts: 439
Joined: Tue Apr 04, 2017 6:06 pm
Location: SF Bay Area, California

Problems using Part.makeCompound with ViewObject

Post by Mark Szlazak »

Would like to combine a group of edges of certain thickness and colour with spheres that represent intersection points of these edges. I used spheres as intersections. The code i used was:

Code: Select all

s1 = doc.addObject("Part::Feature", "s1")
s1.Shape = Part.makeCompound([Part.Shape([Part.Line(dts2[0], dts2[1]),
              Part.Line(e3.Shape.Vertexes[0].Point, e3.Shape.Vertexes[1].Point),
              Part.Line(e6.Shape.Vertexes[0].Point, e6.Shape.Vertexes[1].Point)]),
              Part.makeSphere(mediumPointRadius, dts2[0]),
              Part.makeSphere(mediumPointRadius, dts2[1])])
s1.ViewObject.LineWidth = width2
s1.ViewObject.DisplayMode = 'Shaded'


The problem is with using s1.ViewObject.DisplayMode = 'Shaded' because it causes all the edges to disappear. I am using this display mode for the spheres. How should i go about making this kind of structure?
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Problems using Part.makeCompound with ViewObject

Post by NormandC »

Mark, there's a Python scripting and macros forum where your questions about python should be asked.

Mods, if you could move this topic? Thanks.
Mark Szlazak
Posts: 439
Joined: Tue Apr 04, 2017 6:06 pm
Location: SF Bay Area, California

Re: Problems using Part.makeCompound with ViewObject

Post by Mark Szlazak »

Will do!
Post Reply