Hi
I am making a rule of some powerlines (which should be used as a .rpk to symbolize a polygon (powerline path) in ArcGIS Pro) I am having some issues with the rule file/best practice in ArcGIS Pro, and hope that some of you could help me out here
Here is what I do:
version "2015.2"
attr avstand = 200 // gap between the poles
attr hoyde = 30 // hight
attr bredde = 20 // width
attr farge = "#808080" // color
hatta = "assets/Sketchup/LyseMastNormal5.dae" //asset (both powerline and pole merged)
@InPolygon
@StartRule
trase -->
alignScopeToGeometry(yUp, any, longest)
split(x){~avstand: alignScopeToGeometry(yUp,0) lagHoyspent}*
lagHoyspent -->
alignScopeToGeometry(yUp, world.lowest, longest)
r(90,90,90)
#t(0,0,0)
s(bredde, hoyde, avstand) center(x)
i(hatta)
color (farge)
The rule in a tilted direction
Just the asset, a collada file .dae
Unfortunately, the terrain here in Norway is not as flat as shown in the picture, we got steep hills and mountains where the powerline’s are going, and here is where the problems are starting.
The Powerline is floating in the air
Regards
Jørn
Solved! Go to Solution.
Hi Jørn,
Reordering the vertices might be painful, unless there is a GP tool for that.
I'm thinking it would be much easier to add an attribute to the CGA rule that would use the rotateScope command seen in your start rule.
attr rotateThis = 90 # the default value you have now
Then in your start rule change that one line to:
rotateScope(0, rotateThis, 0)
And you put a field on the feature class to match the RPK attr (whatever you name it in the rule). Populate the field initially with 90 for all shapes, and then go to the ones that are backwards, and edit the attribute to be -90. Also, if the first vertex behaved differently, like if it was on the south side, you might need a 0 or 180, to rotate it correctly.
Does this make sense for your situation?
Chris
I'm not sure why the power line is floating in the air. I don't think it's the code because it seems to work in CityEngine. However, the code does have some scope changes that could be avoided. Here is a shorter version that you could try out to see if the power line still floats.
version "2015.2"
attr avstand = 200 // gap between the poles
attr hoyde = 30 // hight
attr bredde = 20 // width
attr farge = "#808080" // color
hatta = "assets/Sketchup/LyseMastNormal5.dae" //asset (both powerline and pole merged)
@InPolygon
@StartRule
trase -->
alignScopeToGeometry(yUp, any, longest)
rotateScope(0, 90, 0)
split(z){~avstand: lagHoyspent}*
lagHoyspent -->
s(bredde, hoyde, avstand) center(x)
i(hatta)
color (farge)
Thanks Cheryl, this has no effect on the results, but always better with a cleaner script
As for Pro, aligning a single 4-vertex polygon to the terrain is not possible (except when you drape it onto the terrain, but this doesn't actually change the polygon, so the rule won't work as desired in this case). You would have to add more vertices to the polygon and align those to the terrain. But, if you apply your cga rule to the non-flat polygon, then it probably won't work as intended.
So, if you can break up the polygon into several smaller polygons and align each of those to the terrain, this would get you closer to aligning your geometry to the terrain.
We are working on similar problems, and I know this is a tricky issue. We are glad to have your feedback as it gives us a valid use case, so thank you for sharing it.
Again, thank you for the answer Cheryl!
What has happened since my last post:
I managed to get the poles to follow the terrain by actually using interpolate shape tool.
But ass you predicted this wont work as intended.
I have isolated it down to perhaps have something to do with the drawingorder of the start- and endpoint of the underlying polygon.
Ass you see here the orientation of the vertices on the polygon is not following the same drawingorder. It seems to me that they are following "a north-south rule" (the northrn vertex is always the start- and endpoint)
This is important, because the rule is telling that the non-start-/endside of a polygon should start with a power pole and the other side should end with a power cable.
Do you got any ideas how I could have a concise drawingorder of the vertices (same for all the polygon pieces)?
Hi Jørn,
Reordering the vertices might be painful, unless there is a GP tool for that.
I'm thinking it would be much easier to add an attribute to the CGA rule that would use the rotateScope command seen in your start rule.
attr rotateThis = 90 # the default value you have now
Then in your start rule change that one line to:
rotateScope(0, rotateThis, 0)
And you put a field on the feature class to match the RPK attr (whatever you name it in the rule). Populate the field initially with 90 for all shapes, and then go to the ones that are backwards, and edit the attribute to be -90. Also, if the first vertex behaved differently, like if it was on the south side, you might need a 0 or 180, to rotate it correctly.
Does this make sense for your situation?
Chris
Thank's for the help guys, the powerline rule now works like a charm
Hi
Your powerlines look great. Unfortunately I do not have CityEngine and cannot create rule files. I was wondering whether you would be willing to publish your rule set or send it to me, which I could then use in ArcGIS Pro. I'm doing a viewshed and 3D layout, which I am using to learn with.
Many thanks,
Nigel
May I know this is solved with using only interpolate shape tool? I have similar issue that i need to generate tower and lines from the point using rpk rules. but the elevation for the model generated keep not align with the ground