Dynamo 4 Civil - expect arg Geometry,Geometry, called with Solid,Solid

Hi.
I’m using Dynamo for Civil 3d and Im having some trouble.
I am trying to use the Geometry.DoesIntersect, Geometry.Intersect, Geometry.Split nodes.
I am calling these nodes with solids as input.
I am getting the same error message with each of these nodes:
“Warning: Geometry.DoesIntersect expects arguments type(s) (Geometry,Geometry) but was called with (Autodesk.DesignScript,Geometry,Solid[],Autodesk.AutoCAD.DynamoNodes.Solid[])”
Which I find strange because in Dynamo Revit I could always call these nodes with solids.

Any hints on how to get this to work?

Hmmm… looks like this is an namespace issue, with Dynamo expecting a Dynamo solid but receiving an AutCAD solid (hence the AutoCAD showing up in the object type). I had to uninstall yesterday due to a lingering issue from my beta testing time, but be sure you’re pulling the geometry (can’t recall where, but I think it’s under AutoCAD, Object) from the AutoCAD object.

Thanks for your reply @jacob.small .

Here’s a comparison of calling Geometry.DoesIntersect with two different inputs.
The first one is working, the second one is not.

I really would like to get the second method to work,
because eventually I want to collect solids by their layer names, not selecting manually.

So how do I pull the solid geometry from Objects on Layer node as a Dynamo solid?
As you can see I tried an additional Object.Geometry, but that doesn’t lead to anything.

Many thanks

I tried with civil 3d 2020 RTM but cannot reproduce.

what happened to the lower one Object.Geomery. :slight_smile: is it possible to PM me the drawing and script?

Thanks for your help, @angelohbwang
I just retried this myself, and I also could not reproduce the previous errors :slight_smile:
The key difference is that Object.Geometry after All Objects on Layer is not failing this time. In the screenshot that I posted in post 3 you can see that it was returning null.
Strange! But hey, I can continue.

2 Likes

@angelohbwang The same error came back again.

At first I did not understand where this came from.
But after some testing it looks like I have found the cause.
Please see my next posts.

Script and drawing download:

@jacob.small you might also be interested, regards

The difference seems to come from feeding empty lists as input:

failing:

a bit better , but now returning some strange nulls:

A bit more neatly:

When calling Object.Geometry with empty lists, Object.Geometry returns an error message:
…expects DynamoNodes.Object, was called with DynamoNodes.Solid[]” or
…expects DynamoNodes.Object, was called with DynamoNodes.Object[]

When erasing the empty lists, this error disappears.

image

image

I believe it’s the clean node makes it working.
anyway, the failure of one list should not impact the final result, replication should guarantee that.

Yes, you are right. Empty lists were causing trouble. They shouldn’t however, should they?

I would also like to conclude on the nulls described in post 7:
after rebooting my computer this error did not consist.

This reminded me of another annoying DynamoCivil bug that I found can be solved by rebooting:
disappearing nodes. See for example:

A lot of work needs to be done to make Dynamo for Civil more stable!

1 Like

The empty list or null as first element bug is a problem in DynamoCore 2.1 , - you can read about it in the release notes here:

it was fixed in 2.2 and then further improved in 2.3, note there are still some cases where this can cause issues but they are harder to hit, and we have them tracked for fixing.

Simplest workaround is to use List.Clean to remove nulls and empty lists until using a newer core.

2 Likes

To wrap up the solution to this problem:

Call Object.Geometry before running Intersect, Does Intersect or Split.
Especially when operating on geometry collected with ‘Objects On Layer’ node

Problems with Object.Geometry node can arise because of Empty List bug.

Get the null bug? Restart Machine.