How do I get the correct input Autodesk.Revit.DB.xxx VS xxx

I feel like half the time when I try to get the correct input for any node I pick the wrong node that provides the Autodesk.Revit.DB.xxx version when it wants just xxx or vice versa. Is there a way to convert easily between these two forms? Here is an example I’ve ran into today with Document and FamilyType:

AutodeskRevitDBxxx01

Likely this is a namespace collision with a custom node. Can you show what the nodes running into this are, making sure to label the package they’re from if they are custom nodes (Monocle view extension helps)?

Orchid’s document classes frequently clashed this way for me (File.FromPath vs File From Path; Document.Current vs Document Current). Been awhile since I’ve seen this though. Micellany’s Point is another one.

You were right about it being an orchid node. Sorry for the mess I’m trying a lot of things out in the script so it isn’t cleaned up yet.

Once you go into Orchid you kinda have to stay there - mixing Orchid and non-Orchid nodes tends to not work out well. The Orchid GitHub might be a better place to ask as @erfajo isn’t really active in the forums anymore: GitHub - erfajo/OrchidForDynamo: This repository contains the content of the Orchid package for Dynamo.

I get it a lot, I guess it’s inevitable as more and more packages go zero touch…

Perhaps there should be a guidance doc for Dynamo class naming in C#? If List was called DSList it would make design script a lot more concise?

I’m sure there ware arguments against it :stuck_out_tongue:

Hope that wasn’t to off topic,

Mark

Think this might already exist. Perhaps @Michael_Kirschner2 can confirm?


there is this - but one thing I would add - please use namespaces when writing zeroTouch nodes :pray:

2 Likes

Sure, but that doesn’t seem to address the issue of multiple authors doing similar things in different dlls? If there was a convention of putting a pre-fix it would greatly reduce the need to put Autodesk.DSCore.List Autodesk.DSCore.Point etc etc… even if DSList and DSPoint are not so concise… then BiMorph can have BiList, BiPpoint… OrList, OrPoint, ArList, ArPoint etc…

(I know I’m going to lose this one :D)

Cheers,

Mark

1 Like

That would require people to universally agree on certain prefixes belonging to a certain person, which is pretty unlikely. It would also need a directory/registry so people know which ones are already taken. But I understand your point. Namespaces are the solution but it still has drawbacks which are mostly just inconveniences.

Edit: Unless people want to put their full package name as a prefix to classes. Would be pretty annoying to type out BiMorphPoint though.

Hey Kenny,

Great to hear from you…

My counter point would be that people tend to try and make their package names unique, so the zero touch ones I can think of wouldn’t overlap for the foreseeable…

What would be really cute is if the autocomplete let you click on the available options, then gave you a compressed ‘variable’ in the code block… Autodesk.DsCore.List becomes DSList in the background…

But I expect there are more important things on the wish list!

Cheers,

Mark

Edit: My dream would be export Dyn to C# :slight_smile:

2 Likes

Would be nice to have something similar to python’s import x as y so instead of needing BiMorph.Revit.Geometry.X, it would just be y.X or similar. I haven’t spent more than a minute in C# so I don’t know how their imports work.

Edit: Meant for codeblocks but then again, I don’t have much experience using other packages anymore so I wouldn’t take my suggestions too seriously.

1 Like

I tried again with a fresh script. All built-in dynamo or Orchid. Still doesn’t work. The same input seem to work with other nodes from Orchid that look like they want the same thing.

Can you post a DYN with just those nodes please?

Github response

I got a response on the Github. I’m still trying to figure out based on his sample scripts. Apparently I shouldn’t say “script” but I think this post has cemented my use of it for all time.

1 Like