Hi (@dale )
I’m having difficulties understanding the IGH_DocumentObject on Python3.
Accessing the contents of a GH_Cluster in Python2 or IronPython works, but converting to Python 3, the cluster object is not a cluster object at all anymore.
How can I access the content of IGH_DocumentObject in Python 3?
OnPingDocument only gives me the parent, but not the content itself.
Ip vs P3.gh (13.6 KB)
I don’t think it’s possible, at least not until 8.7 at the earliest.
The IGH_DocumentObject
reminds me of these known issues:
I applied a fix for this type check problem. It’s not perfect but the problem area is complicated especially between how IronPython used to work and how Python 3 interop with dotnet runtime is expected to work.
This code works now:
for obj in gh.Instances.ActiveCanvas.Document.Objects:
if isinstance(obj, gh.Kernel.Special.GH_Panel):
if obj.NickName == Panel:
obj.Properties.Colour = Color
type(obj) is gh.Kernel.Special.GH_Panel will not work because the returned object …
https://mcneel.myjetbrains.com/youtrack/issue/RH-81135
eirannejad
(Ehsan Iran-Nejad)
March 25, 2024, 8:13pm
3
@Toni_Osterlund
Try
isinstance(obj, Grasshopper.Kernel.Special.GH_Cluster)
As @James_Parrott pointed out there is a bug related to this that we have fixed for the next version
@eirannejad
I tested this before, but I could not get it working.
Gh1.0.0008
Rh8 SR5 (8.5.24072)
I wouls also like to point out the mis-aligned “zoom box” from the component to the script window.
1 Like
eirannejad
(Ehsan Iran-Nejad)
March 27, 2024, 2:43pm
6
@Toni_Osterlund We have fixed this bug for the next version of Rhino (8.7). You can download the 8.7 Release candidate in about two weeks
1 Like
eirannejad
(Ehsan Iran-Nejad)
March 27, 2024, 2:44pm
7
I also have a ticket to fix the cone problem
RH-75781 Script editor Component cone wrong.