An object's parent or children

Getting rhinoscriptsyntax up-to-date with RhinoScript is on the to-do list.

https://mcneel.myjetbrains.com/youtrack/issue/RH-37567

– Dale

Thank you, Dale.

The meaning that I wrote yesterday is not Python Script Editor ‘s Help but Rhinoscript Editor’ s Help does not have a notation of Methods related to History such as “ObjectChildren”.
Those Methods can be executed even though they are not written in Help.
How do I know their existence?

Dale.

I’m sorry.
Now I found it.

Dale,

I use the following method when using Methods which is in Rhinoscript (vbScript) but not in PythonScript rhinoscriptsyntax.

I write a few lines of source code including Method to be used with Rhinoscript and save it in Filename.rvb.
I execute “_-LoadScript Filename.rvb” command with Rhino.RhinoApp.RunScript method of RhinoCommon using PythonScript.
I use DocumentUserText for parameters and return values.

However, I do not think it is a smart way.
Is there a way to use Rhinoscript’s Methods in PythonScript source code?

Try this:

import System
import Rhino

def TestRhinoScript():
    # The RhinoScript plug-in id
    rs_id = System.Guid('1C7A3523-9A8F-4cec-A8E0-310F580536A7')
    # Get the RhinoScript COM object
    rs_obj = Rhino.RhinoApp.GetPlugInObject(rs_id)
    if rs_obj:
        rs_obj.Print('Hello from RhinoScript!')
    
TestRhinoScript()

– Dale

Thank you, Dale.

Successful.
Chohhh kakkoii ! (It’s cool.)
I’m very happy.

I am not good at English but I’m really glad to post it.
I was able to learn a lot.

Thank you.

It will deviate from the first theme.

From that, I also tried other Rhinoscript methods.
ReplaceGeometry, RemoveCurveKnot worked properly, including ObjectChildren.

However, RemoveSurfaceKnot does not work properly.
The message “Message: オブジェクト参照がオブジェクト インスタンスに設定されていません。” appears on the Output screen of PythonScriptEditor.
Is there a solution?

You can replace the geometry of an object from Python.
There is a nice sample at the bottom of this page:
http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_Tables_ObjectTable_Replace_4.htm

Don’t know about the other problems you mentioned.
Jess

Thank you, Jess.

Yes, I have known ObjectTable.Replace Method.
And I always use it.

But, there is a reason for me to use Rhinoscript 's ReplaceGeometry Method.
When updating KinkySurface with Rhinoocomon’s ObjectTable.Replace Method in Rhinoceros 5,
it changes to Polysurface.
To avoid this, I need to create a new KinkySurface as a SingleSurface with the ObjectTable.AddBrep Method
and replace it with the geometry of the original object ID using Rhinoscript’s ReplaceGeometry Method.