VBA Excel macro for any object geometry modifications (API)

VBA Excel macro for any object geometry modifications (API)

Rafal.Gaweda
Autodesk Support Autodesk Support
28,685 Views
63 Replies
Message 1 of 64

VBA Excel macro for any object geometry modifications (API)

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

For those who might be interested I am attaching xls file with macro for objects geometry modifications.

One button to import geometry (characteriscic points coordinates) of selected objects (lines, polylines, arc, circles, panels), second - to update their geometry basing on data in Excell.

NOTE: modify only cells with coordinates.



Rafal Gaweda
Accepted solutions (1)
28,686 Views
63 Replies
Replies (63)
Message 2 of 64

Anonymous
Not applicable

Hello!

 

I tried your excel sheet, but it doesn´t recoginze that robot is open.

How should i use the macro?

 

/Per

0 Likes
Message 3 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

Go to VBA Editor (Alt+F11), go to References, unmark Robot Object Modeler, close References window by pressing OK, open it again, select  Robot Object Modeler ver. 12.0., press OK

 

references.JPG



Rafal Gaweda
0 Likes
Message 4 of 64

Anonymous
Not applicable

I´ve tried your solution on the problem, but it still gives the same error message.

 

/Per

0 Likes
Message 5 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Try: 

1. Run Excel as Administrator, run Robot as Administrator, then check macro

2. Check \ set UAC :

UAC.jpg

 



Rafal Gaweda
0 Likes
Message 6 of 64

Anonymous
Not applicable

This gives the same error.

0 Likes
Message 7 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

I need to ckeck it on your computer

Please register this isseu as Service Request or give me your details in Private Message



Rafal Gaweda
0 Likes
Message 8 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

In such case unregister ALL ROBOTS you have installed on your computer by command: path_to_robot.exe / unregserver

 

eg:

"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2011\System\Exe\robot.EXE" /unRegServer

 

then 

 

register the one you want to use.

 

eg:

"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2012\System\Exe\robot.EXE" /RegServer



Rafal Gaweda
Message 9 of 64

Anonymous
Not applicable

Hello,

 

I had the same problem which i managed to solve with the help of the structural support team:

 

http://forums.autodesk.com/t5/Autodesk-Robot-Structural/Robot-API-for-ARSA-2012-error-429/td-p/32153...

 

A colleague of mine recently upgraded from ARSA 2011 to 2012, and our excel VBA API was unable to recognise that 2012 was open.  I tried to deregister both and register 2012 (with administration rights) with the method described in this post, but it didn't work.

 

I remember last time this happened Structural Support and I worked through the registry looking for and deleting outdated ARSA 2011 entries... can you tell me what to look for, what to delete, and what to keep?

0 Likes
Message 10 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

JUst to link some threads .

Modified macro with rounding:

http://forums.autodesk.com/t5/Autodesk-Robot-Structural/Panel-contour-points-modification-API/td-p/3...



Rafal Gaweda
Message 11 of 64

Anonymous
Not applicable

How do I do actually run the below command? Do i need to open a cmd prompt first, then rund the relevant commands? Do I run them with or without the quotations?

 

Thanks


@Anonymous_Adsk wrote:

In such case unregister ALL ROBOTS you have installed on your computer by command: path_to_robot.exe / unregserver

 

eg:

"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2011\System\Exe\robot.EXE" /unRegServer

 

then 

 

register the one you want to use.

 

eg:

"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2012\System\Exe\robot.EXE" /RegServer


 

0 Likes
Message 12 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support
Message 13 of 64

Anonymous
Not applicable

Thx for this macro but I can import only panel contors and if I select some bars to change the coardiantes , a meesage appera that I'm not sellecting any thing

0 Likes
Message 14 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support
Bars do not have any coordinates so it is impossible to correct them.
You can correct nodes coordinates in Nodes table or using this addin : http://forums.autodesk.com/t5/Robot-Structural-Analysis/Rounding-up-coordinates-API/td-p/3430533/pag...


Rafal Gaweda
0 Likes
Message 15 of 64

Anonymous
Not applicable

Hello,

 

With this addin we can only round up or down nodes coordinates, how can we modify them?

 

Thank you!

0 Likes
Message 16 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support
Robot -> Nodes table


Rafal Gaweda
0 Likes
Message 17 of 64

Anonymous
Not applicable

Thank you.

 

 

Thanks to you I have an addin for modifying panels. Is there any addin for nodes?or how to write it in API?

 

 

Saraneiya

0 Likes
Message 18 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Example attached.



Rafal Gaweda
0 Likes
Message 19 of 64

mgaafar
Advocate
Advocate

Hi Rafal, hope you are doing well.

I was working in a project in the USA and had to use imperial units. the model has many inclined walls which creates rounding errors at edges.

now when i use all the excel files with API similar to the one attached, it extracts the selected data into excel in SI unit although the model is created in imperial units.

how can i force the API to use the same units as the model? 

0 Likes
Message 20 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

API itself uses internal Robot units which are SI units.

 

If you want to use different units, for example get \ set "structure dimension" you have to check this unit and its coefficient (for \ from meters in this case) and use this coefficient (or 1/coeff) while playing with other units

 

Example code how to get structure dimension unit and coefficient

 

Private Sub CommandButton1_Click()


Dim Robot As New RobotApplication
Dim projPref As RobotProjectPreferences
Set projPref = Robot.Project.Preferences

Dim RU As RobotUnitData
Set RU = projPref.Units.Get(I_UT_STRUCTURE_DIMENSION)
Dim RUED As RobotUnitEditionData
Set RUED = projPref.Units.UnitEdition.Get(I_UMT_LENGTH, projPref.Units.UnitEdition.Find(I_UMT_LENGTH, RU.Name))

MsgBox RU.Name + "   " + Str(RUED.Coefficient)

End Sub

So RUED.Coefficient should be used as a multiplier while getting coordinates and 1/RUED.Coefficient while updating Robot model.



Rafal Gaweda
0 Likes