Isocurves on Surface In Codeblock

Hi All

For some reason, I’ve never been able to use the isocurve on surface function in a code block.
I always have to use the node and return to the code block.
Is this a problem with dynamo, or am I getting something wrong?
Please see the .dyn file attached.
Thanks.



Makino.dyn (44.8 KB)

search the forum for -namespace collision-
just a guess

1 Like

@bayowindapo so you’re saying that you’re unable to use the Curve.ByIsoCurveOnSurface function in a code block node, correct? Is this the way you tried using it? As you can see the version of the isocurves generated from the code block matches with those generated by the node. Or am I misunderstanding your problem?

Any time a surface comes to a ‘point’ on the U or V axis you will have a warning when attempting to generate the ‘point’ isocurve due to the line by coincident points.

Note the circled area in the lower corner of this image - you can’t have a line there isn’t a depth to put a line in place.

1 Like

Hi there.
Thanks so much for the reply. I’ve done exactly what you have on my computer, and still, the function does not work. Maybe it is my dynamo version.

Thanks will have a look.

Give this a shot and let us know what you get a result, including the warning message exactly as it shows up (expand it, select the text, and hit ctrl+c to copy it):
Isocurves via Designscript.dyn (6.4 KB)

1 Like

Thanks. I get that. The issue I’m having is that the Curve.ByIsoCurveOnSurface function does not work in my codeblock.

What is the exact error you’re getting? As noted before it may be a namespace collision with one of your installed packages using the “Curve” namespace.

Good morning. So I’ve tried this on Revit 2021 (I was working on 2019), where I have not installed many packages, and it does work in the code block. It must be the namespace collision, as you have noted. Is there a way to fix this because I need all the packages I have installed. In the meantime, I will do some research on namespace collision.
Thanks!

We need the full error message to know what specific namespace to resolve… as noted a few times now:

Hi Jacob. Apologies.
See text and image.

Warning: Multiple definitions for ‘Curve’ are found as Autodesk.DesignScript.Geometry.Curve, Curve
Multiple definitions for ‘Curve’ are found as Autodesk.DesignScript.Geometry.Curve, Curve
Multiple definitions for ‘Curve’ are found as Autodesk.DesignScript.Geometry.Curve, Curve
Cannot find static method or constructor Curve.ByIsoCurveOnSurface()
Cannot find static method or constructor Curve.ByIsoCurveOnSurface()

@bayowindapo …not sure it will work for you…but try to insert…Autodesk… here

Screenshot 2021-06-23 063747

3 Likes

Hi there.

It worked like a charm! Thanks a lot.

3 Likes

@bayowindapo in cases of a namespace collision where you have more than one class named Curve, the engine cannot infer which class you’re referring to unless you prefix the class name with its full name, i.e. including its namespace. In order to make it easy which namespaces are available for you to use, code block node autocomplete should assist you in doing so. When you type Curve in the code block node, it should prompt you with all the namespaces available with the type Curve. For example in this screenshot you can see there are two classes named Mesh but they are prefixed by different namespaces to identify them uniquely. If you know which namespace to use, you can pick the appropriate one from the list.
image

Typically all builtin Dynamo classes have their namespaces include Autodesk and DesignScript. You can choose an option that has either or both of these as a prefix if you intend to use the native Dynamo types.

3 Likes

Thanks for this. Appreciate the information.
Cheers.

1 Like