I have a question that I want to create object solid from spline.
Can you show code C++ or Python ?.
Thanks you very much.
welcome to the forum. I am afraid this is not how things are working here. Your question is rather vague and also of such complexity that probably neither the SDK team nor forum members are willing to do the work for you. Some pointers.
Hello and welcome,
before posting, please make sure you are familiar with this forum's rules and procedures: How to Post Questions
What kind of plugin do you want to write? A simple script, a tool or a generator? Are you familiar of the basic concepts of Cinema 4D? Do you have any previous coding experience?
For simplicity's sake I will present some Python code in form of a Python Script. The concepts can be transferred to C++ as well.
A polyon object is created by creating an instance of the PolygonObject class. This instance can be modified and then inserted in to the document.
# create polygon object
numberOfPoints = 4
numberOfPolygons = 1
polyObject = c4d.PolygonObject(numberOfPoints, numberOfPolygons)
if polyObject is None:
raise RuntimeError("Could not create PolygonObject.")
# set points
points = 
# set polygons
polygon = c4d.CPolygon(0,1,2,3)
# insert object into document
doc.InsertObject(polyObject, None, None)
# update C4D
Similarly, a spline is represented as a SplineObject. You can use the SplineHelp class to access positions along the spline:
# access active object
if op is None:
raise RuntimeError("No object selected")
# check if active object is a spline object
if op.GetType() != c4d.Ospline:
raise RuntimeError("Object is no spline object")
# init SplineHelp
splineHelp = c4d.utils.SplineHelp()
res = splineHelp.InitSpline(op)
if res == False:
raise RuntimeError("Could not init SplineHelp.")
# Sample positions along the spline
for i in xrange(20):
offset = i * .05
pos = splineHelp.GetPosition(offset, 0)
With that information you can build your poylgons.
You find more complex examples how to create poylgon objects in various generator plugins:
The purpose of me is export model from revit to cinema 4d.
I choose other way.
Thanks you very much.