Grasshopper

algorithmic modeling for Rhino

I have a problem,

 

I found an old vb script for gh version 0.59 but when I try the script on latest version 0.8.0010 gives me the following problem:

 

error: Unable to cast object of type 'Rhino.Geometry.Point3d' on type'RMA.OpenNURBS.On3dPoint'. (line: 108)

 

How can I fix this?

 

Thanks 

Views: 963

Replies to This Discussion

Hi Mirko,

It would be helpful to see a little code to be able to figure out what is going wrong.

Thanks,

-Steve

sure!

 

Hi Mirko,

you need to use the "legacy Vb.Net" component, because that script was written with the old SDK. You can find it in the drop-down menu.

- Giulio
_______________
giulio@mcneel.com
McNeel Europe

Thanks Gulio, but I still have other problems!

 

I have used the new VB component and i have updated some commands in new SDK. But out gives me other errores that i don't understand how to solve.

 


Yes, the calls are not the same: you need to check one-by-one all methods that were called in the old SDK and translate them in the new one.

There is unfortunately no magic wand... you can always chose to use the old SDK with the legacy component, though.

- Giulio

_____________
giulio@mcneel.com
McNeel Europe

how do I use the old SDK? Would give problems for the other components of gh?

 

Also, if I may decide to update the code, how can I convert the method "rhUtil.RhinoBrepClosestPoint" in new SDK? 

I have tried use Rhino.Geometry.Point3d. (but does not appear closestpoint )

 


The old SDK is to be found in one of the old (legacy) scripting components:

> Would give problems for the other components of gh?

It should not.

 

> Also, if I may decide to update the code, how can I convert the method "rhUtil.RhinoBrepClosestPoint" in new SDK?

With code similar to this:

Dim b As Brep = ABrepFromSomeWhere()
Dim pt As Point3d = New Point3d(1, 1, 1)
b.ClosestPoint(p)

 

- Giulio
_______________
giulio@mcneel.com
McNeel Europe

the legacy scripting component doesn't work.

As you can see by clicking on the image when i open che old gh file, che scripting component is already legacy version!

Thanks Giulio for your time

 



I could be wrong here but as far as I can tell the variables being passed to the .closestpoint don't have any values assigned to them so the error message is related to that...is it not?

mmm i'm not sure to understand :D

 

The out of VB component (legacy) said:

Unable to cast object of type 'rhino.geometry.Point3d' on type'RMA.OpernNurbs.On3dPoint' (line:102)

 

The line 102 is a call..

 


 

 

Attachments:

To make the old version work: you simply need to set the type of input in Pc as OnPoint3d in the component.

The new version has a couple of problems still, but for sure you need to initialize sup (line 118: "Dim sup As Brep = S.ToBrep()").

I'll have a look if I can discover how to make also the new version work.

- Giulio

____________
giulio@mcneel.com
McNeel Europe

Hi Giulio,

Sorry to hijack your thought process from here, but Rassul is having difficulty with a mesh in this thread would you be able to shed some light on the situation?

Danny

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service