Hi,
I have a Python script part, that I wrote with the use of InternalDBObject property, but since I went after this unwrapping topic a bit, I want to rewrite it using InternalObjectId property.
Here are the old and new scrip parts (the variable namings are a bit different but not that cause the problem). The old one works well, but when I’m running the new one, an unhandled exception occurs and the whole Dynamo and C3D collapse and I haven’t found out the reason. The center_xy block is good, I get result for that, but when I allow to run the script for left_xy block also, it collapses.
Old:
# nested list from X, Y coordinates in the alignment centerline
centerXY = []
for i in station:
centerXY.append(alignment.InternalDBObject.PointLocation(i, 0, 0, 0))
# nested list from X, Y coordinates parallel to the alignment offsetting it by the samplePointOffset values on the left side
leftXY = []
for i in station:
j = 0
while j < len(samplePointOffsetLeft):
leftXY.append(alignment.InternalDBObject.PointLocation(i, samplePointOffsetLeft[j], 0, 0))
j += 1
New:
# nested list from x and y coordinates in the alignment centerline
center_xy = []
for i in station:
center_xy.append(t.GetObject(alignment.InternalObjectId, OpenMode.ForRead).PointLocation(i, 0, 0, 0))
# nested list from x and y coordinates parallel to the alignment offsetting it by the samp_pt_offset_left values
left_xy = []
for i in station:
j = 0
while j < len(samp_pt_offset_left):
left_xy.append(t.GetObject(alignment.InternalObjectId, OpenMode.ForRead).PointLocation(i, samplePointOffsetLeft[j], 0, 0))
j += 1
To be honest, I still not understand well what is the difference of InternalDBObject and InternalObjectId in usage. Maybe I need some more time to think about it