Convert var to string, and string to element Dynamo

Hi All,

So I am trying to pull data from excel into Dynamo, to update/create line styles.
It falls apart at the node “LineStyle.Create”, and kicks the following error:
“Warning: Internal error, please report: Dereferencing a non pointer. Internal error please report: Dereferencing a non-pointer
LineStyle.create expects argument of type(s) (string, int, Element, Color), but was called with (var, int,string, DSCoreColor).”

I can’t seem to figure out how to convert my list to a string, I don’t want it to have a suffix or separator, (at least not as far as I know) or how to convert my string into an element. I’m at a loss. Any ideas?

LineStyleCreation.dyn (136.3 KB)

Edited for typos

Hi @GJax89

Error says you need to connect LinePattern Element but you’re connecting it as String:

Hello @Kulkul

Bimorphnodes claims this can be done with lists to batch create:

This is what I am trying to accomplish, Can this only be done with manual text entry in a code block, or is it possible to convert my string into a list for this purpose? I already have the names, and line patterns in string form, I am trying to convert them to something the node will read as intended.
My goal is to create these as a batch.
So how can I convert what is being called as a var to a string, and a string to element names, if at all?

Could you post your rvt and excel file here? I will show you how.


TESTPROJ.rvt (3.4 MB)
Linetypesfromtemplate.xlsx (9.7 KB)

Try this:
LineStyleCreation_For Greg.dyn (151.1 KB)

Hi @Kulkul

That doesn’t kick an error, But if I try to add a new type to the list, it does not get created in a project. Am I missing something? I really appreciate all your help!

Edit: To clarify I mean if I add data to the excel file in the same formatting

Hey, the script returns Null for 32/34 items. I am trying to get this to work, any ideas? Apologies for the delay, Work caught up with me.