Notifications
Clear all

[Closed] Convert Line to SplineShape (IShapeObject to ISplineShape)

Hi, aandres!
Casting to some other type is a dead end.
createInstance
returns IntPtr which I can’t cast to linearshape.
Maybe we can directly create polyShape using createInstance, but don’t know how and if it is possible at all.
I think adding an empty modifier shouldn’t be a big deal in terms of performance.

[quote=]dotNetObject:Autodesk.Max.Global
dotNetObject:Autodesk.Max.SClass_ID
dotNetObject:Autodesk.Max.Wrappers.Class_ID
– Error occurred in anonymous codeblock; filename: ; position: 308; line: 6
– Unable to convert: dotNetObject:System.IntPtr to type: Autodesk.Max.ILinearShape
OK


g        = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
mySClass = (dotNetClass "Autodesk.Max.SClass_ID").Shape
myClass  = g.Class_ID.Create ((dotNetClass "Autodesk.Max.BuiltInClassIDA").LINEARSHAPE_CLASS_ID).value__ 0 --ILinearShape class
iln      = dotNetObject "Autodesk.Max.ilinearshape" (g.CreateInstance mySClass myClass asdotnetobject:true) -- ILinearShape 
-- ps       = iln.Shape

Page 2 / 2