Assign material

Hey,
Im trying to create script that reads from excel table and creates towers. Im completly new to Dynamo and I have some issues…

  1. What is the best way to filter connection type? I’ve tried something but I have to make 5-6 more connection types and this way looks too complecated for me…

  2. How can I read profile types from excel and assign them by Dynamo?

  3. If I create analytical member by curve its working as I want but its not having properties… If I create analytical member by element-they are not connected(probably because of z Justification but I dont know how to change it also-SetParameterValueByName is not working with strings…). How can I assign physical to analyctical without changing geometry?

Thanks!
Tower data.xlsx (10.2 KB)
SegmentTower.dyn (410.2 KB)

1 Like

Hello @apd - welcome to the Dynamo Forums! :wave:

Without having your model to work on to pull the exact data you have, here are some possible answers to your questions :slight_smile: Let me know if any of them help!

  • If you are pulling in lots of options from Revit, then you can use one of the following options:

    • Use the RemoveIfNot node to pull a particular one out of the list.
    • Use a String from Object node, a String.StartsWith node and a List.FilterByBoolMask node.
    • Ideally, a graphical example here would help!
  • Do you mean that you want to read in a string (text) value from Excel and then use Dynamo to pull the correct element from Revit? If so, you could try using the FamilyType.ByName node to pull the type, then the FamilyInstance.ByPoint node to create an instance.

  • SetParameterValueByName node needs the actual data type of the parameter to set. This means a “Yes/No” value will need a “True/False”, something wanting a string (Text) will need a String. So if you are requiring to set a numerical value from a string, you could try the String.ToNumber node.

Thanks @solamour !
I still have issue with 3 question…

Also I cant add loads:

Im writting again here, to avoid opening new thread. Why normal is not changing when I change points?

Hello @apd - Our sincerest apologies on this one, there is a bug that exists in Revit 2023 that will be fixed in Revit 2023.1. Unfortunately we had issues with our build pipeline on the Revit 2023.0.2 hotfix so it didn’t make it in.

Please refer to Error - specTypeId is not a measurable spec identifier? - #17 by scott.tomlinson as a workaround should you choose to take it.

@solamour Its not working for me, because I have to choose Origin, Top, Center or Bottom…
Also I think there is issue in GetParameterValueByName:


I cant take Family Names.

@apd is this after you did the fix in my linked post above?

@solamour
No. This is after Select Model Elements->AnalyticalMember.ByElement->This(GetParameterValueByName)
I cant find way to fix SetPerameterByName. Its not same like in the post. I want to change “z Justification” and it contains only string.

Hello @apd - I’m not super familiar with Analytical Models as I’ve not worked with them. Just wanted to check that the parameter values you are trying to set are on that object, or actually on the Structural member?

As per my screenshot below, you can see that these parameters for “Z Justification” are actually part of the Structural Element, not the Analytical One. So if this is true, given there is no “Z Justification” parameter on the Analytical Model, you won’t be able to set anything there.

No, Im trying to take it from structural element, to change it to Origin and then create analytical model by element.

Ok cool - Then you probably need this :slight_smile:

The Parameter of z Justification requires an Integer to set the value, not a string. It looks like a string inside of Revit, but when you use “GetParameterValueByName” in Dynamo, it will return an integer. You can see this below:

The integers correlate to different values, as shown in the note :raised_hands:

0 = Top
1 = Center
2 = Origin
3 = Bottom

apd_SetZJustification.dyn (9.7 KB)

@solamour I’ve tried it… Its same with your nodes also:


image
Thanks anyway!

@apd you still need to do the fix (Replacing RevitNodes.dll) I have linked above - that’s what the error message is stating.

Otherwise, this will be fixed in Revit 2023.1.