Rotate all objects using data source

Rotate all objects using data source

Karadzhaian_Eduard
Advisor Advisor
1,183 Views
10 Replies
Message 1 of 11

Rotate all objects using data source

Karadzhaian_Eduard
Advisor
Advisor

Hi all,

I want to add design lightpoles to my Infraworks model.

As an existing source data i use AutoCAD blocks, either of them have an individual rotation angle. 

I try to import this data using GIS format (.sdf) - data completely have been added to Infraworks with standart rotation angle for all objects.

Next I want to automatically rotate all data objects using script:

Eduard_Karadzhaian_0-1592692779342.png

But it doesn't work.

I'll be glad to get any advices ASAP.

Thanks in advance


Eduard Karadzhaian
Senior Civil Infrastructure Engineer
Blog| LinkedIn| E-mail| Youtube|



0 Likes
Accepted solutions (1)
1,184 Views
10 Replies
Replies (10)
Message 2 of 11

andrewofabley
Advocate
Advocate

@Karadzhaian_Eduard 

If your SDF has a a rotation attribute on it, you can map that to the 'rotate z' field in the table view at import. No script required.

AEC Collection / Safe FME / ESRI ArcGIS / Unreal Engine
Digital Engineering Lead, Compulsive Problem Solver.
0 Likes
Message 3 of 11

Karadzhaian_Eduard
Advisor
Advisor

@andrewofabley could you please confirm this information using screenshot?

In 'rotate z' field it is impossible to input rotation attribute name or choose it from list. There is a possiblity to input only absolute values. Essentialy I have rotation attribute in my .sdf file.

 
 

Screenshot.PNG


Eduard Karadzhaian
Senior Civil Infrastructure Engineer
Blog| LinkedIn| E-mail| Youtube|



0 Likes
Message 4 of 11

Karadzhaian_Eduard
Advisor
Advisor

Another situation with "Set elevation" value. Here there is a possibility to adjust any attributes values.

 Screenshot_2.PNG


Eduard Karadzhaian
Senior Civil Infrastructure Engineer
Blog| LinkedIn| E-mail| Youtube|



0 Likes
Message 5 of 11

Karadzhaian_Eduard
Advisor
Advisor
Accepted solution

My problem solved.

Really script was so easy:

function Process(SOURCE, CITY_FURNITURE) {

CITY_FURNITURE.MODEL_ROTATE_Z = SOURCE["ATTRIBUTE_NAME"]*180/3.14;


return true;
}


Eduard Karadzhaian
Senior Civil Infrastructure Engineer
Blog| LinkedIn| E-mail| Youtube|



Message 6 of 11

Karsten.Saenger
Autodesk Support
Autodesk Support

Hi @Karadzhaian_Eduard ,

 

just for answering the open question about where to define the rotation - if you have an attribiute in the SDF/SHP files for rotation, you can select it in the table tab:

 

    test_points.png

 

Regards,

Karsten.



Karsten Saenger
Message 7 of 11

inception2708
Participant
Participant

How to export object in Civil 3D with attributes, I use command MAPEXPORT but it no attributes, please help!

0 Likes
Message 8 of 11

mark.reeveTXANL
Contributor
Contributor

I try the above method and am still not getting the same rotation as in CAD. I have an SDF with extracted rotation values, I map that attribute (and convert from radians) but it is still a different rotation to the CAD. The value is the same but the angle is different.

0 Likes
Message 9 of 11

namlt33
Advocate
Advocate

Go to data tab, select "select attributes" chose the properties you want 

namlt33_0-1735645127852.png

 

0 Likes
Message 10 of 11

sconroy
Advocate
Advocate

Thanks for this - I know it's an old post, but it helps!

There's a couple of things I did differently in v2026 as the above didn't quite work for me as posted.

 

1. I entered the formula in the table tab rather than in the script tab as the latter didn't work

2. I corrected the rotation by subtracting 90deg due to the orientation from my export from AutoCAD. 

 

Easy corrections to make!

 

sconroy_0-1756486418513.png

 

 

Sean
Dell Precision 7740 Intel Core i9-9880H CPU @ 2.30Ghz -32GB RAM Windows 10 Pro - 64Bit
NVIDIA Quadro RTX4000 video card dual/dual monitor setup
Civil 3D 2019.3.4 w/ AutoCAD 2019.1.4 / Infraworks 26.0.0.16

Message 11 of 11

srksphillips
Advocate
Advocate

I’ve run into the same issue before, and it usually comes down to one (or both) of the following causes:

 

Model Orientation

 

The 3D model might not be facing the correct direction.

  • Try rotating the model so it aligns with the green axis (X-axis).
  • In my case, I had to rotate the model of the lighting column 180 degrees.
  • Important: Don’t rely on the ViewCube for orientation—it can be misleading.

srksphillips_1-1756915692077.png

 

Rotation Angle Direction

 

Your attribute values might assume clockwise rotation from North, but InfraWorks uses counter-clockwise rotation.

  • This means your lighting columns (or other features) may rotate, but not in the direction you expect.
  • To correct this, subtract your angle from 360:
    • For example: 360-[insert attribute name] e.g. 360-Bearing
  • My bearings are in degrees from North, not radians—so make sure your data matches that format.

srksphillips_0-1756915340206.png

 

Cheers,

Steve

 

0 Likes