Grasshopper

algorithmic modeling for Rhino

How do i get GUID from type of 'PlaneSurface' in GH_Python

I have two  'PlaneSurface'  input Parameter in GH_pyhton.And i want to use `booleanUnion`  these input . But it got error  below.

        *x,y=PlaneSurface

code

import rhinoscriptsyntax as rs
print(type( x ))
arr=[]
arr.append( x )
arr.append( y )
#print(arr)
rs.BooleanUnion( arr )
a=arr

error

Runtime error (ValueErrorException): unable to convert <Rhino.Geometry.PlaneSurface object at 0x000000000000003A [Rhino.Geometry.PlaneSurface]> into Brep geometry
Traceback:
  line 524, in coercebrep, "C:\Users\sora\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
  line 563, in BooleanUnion, "C:\Users\sora\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\surface.py"
  line 11, in script

maybe i have to use type of GUID inputParameter of 'booleanUnion'.How can i get GUID from type of PlaneSurface?

Views: 2991

Attachments:

Replies to This Discussion

You could either set the "Type Hint" on the Python component to "Dynamic (rhinoscript GUID when geometry)" for the input surfaces, or, use a corresponding RhinoCommon functionality directly. I think that someone did post about getting GUIDs from objects, but it is really a sort of roundabout way of going about it I find. Also make sure you assign the boolean function to a variable like so:

a = rs.BooleanUnion(arr)

Thanks Anders.

I tried but i got other error.

error

/////////////////////////////////////////////////

<type 'Guid'>

Runtime error (ValueErrorException): unable to convert 6a228564-8fb5-42e1-a6ad-1dac55813897 into Brep geometry
Traceback:
  line 524, in coercebrep, "C:\Users\sora\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
  line 563, in BooleanUnion, "C:\Users\sora\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\surface.py"
  line 11, in script
/////////////////////////////////////////

I setted GUIDs to "BooleanUnion" 's argument. But "BooleanUnion" did not expect Guid.

What should i set to "BooleanUnion" 's argument?

Have a look at the attached files, they seem to work without throwing any errors. That said, I'm not exactly sure that the boolean union results are what you are looking for.

Edit: Had a bit of trouble uploading, hence the multiple deletes of this reply. Apologies.

Attachments:

Thanks Anders.

I checked the attached files  then i seemed those files  was same as mine.So i reopened files ,then   they  worked without  any errors.

Thanks again.

No worries, glad that it worked out for you.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service