M_c3d
February 20, 2021, 12:35am
1
Hi everyone,
First time using dynamo so apologies.
I’m trying to modify a script that I was provided with to change civil 3d pipe styles based on ARCGIS property data.
The ARCGIS property data I’m trying to use to set the style is called subtype and is set as either 10, 11 12 or 15.
I’m getting an error at List.GetItemAtIndex
Warning: List.GetItemAtIndex expects argument type(s) (var[]…[], int), but was called with (var[], var[]).
Can anyone shed any light on the issue?
Thanks in advance.
Michael
SeanP
February 20, 2021, 12:41am
2
Make sure that the Index of the node is getting Integer values and not string or any other data types. You can use the Object.Type node to check it.
M_c3d
February 20, 2021, 12:45am
3
Hi @SeanP it is string!
How do I change this to interger?
Thanks!
M_c3d
February 20, 2021, 2:50am
4
@SeanP
Just to add some additional info, part of script shown below.
The property name is subtype and I want to use the number from subtype to assign the pipe style.
SeanP
February 20, 2021, 4:20am
5
Have you done some searching?
Daan
February 20, 2021, 5:11pm
6
@M_c3d Try the node String to Number .
1 Like
M_c3d
February 20, 2021, 10:57pm
7
What part to I add the node? Is it the code block for a property value that needs to be numeric? Thanks!
Daan
February 21, 2021, 1:02pm
8
Into the input of the list.getitematindex node, however i dont see that node in your screenshot, could you maybe post that part with the error?
M_c3d
February 21, 2021, 1:18pm
9
Hey @Daan I’ve attached the script (sorry wasn’t able to do it previously as new member).
Also attached error at list.getitematindex
DataStylization_ApplyStylesFromExcel.dyn (51.0 KB)
That Dynamo graph looks familiar, how did you get hold of it?
M_c3d
February 21, 2021, 4:09pm
11
Ramesh at the Infraworks team provided it.
That’s ok then, I made it for him. It was designed to work only for Property Sets with string values.
1 Like
M_c3d
February 21, 2021, 4:17pm
13
Apologies, I had no idea it was yours! I had queried with Ramesh how to assign civil 3d pipe styles based on a property set from ARCGIS and he suggested amending this script to suit.
Is it possible to amend it to work with property sets that have integer values?
Thanks,
Michael
You also need to change the values in the associated Excel that I assume you have
M_c3d
February 21, 2021, 5:11pm
16
Hi @Paolo_Emilio_Serra1 yes I have updated the excel to include the subtype.
It has came up with an additional error. The index seems to have an empty list.
DataStylization_ApplyStylesFromExcel.dyn (3.7 MB)
The Excel file is returning strings or integers? can you use the Watch node where it says features = a[0]; >? Also in the same output can you use the node Object.Type? Also take a screen shot of the Excel
1 Like
I cannot see the output of Object.Type
1 Like