Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA Excel macro for any object geometry modifications (API)

63 REPLIES 63
SOLVED
Reply
Message 1 of 64
Rafal.Gaweda
19233 Views, 63 Replies

VBA Excel macro for any object geometry modifications (API)

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
63 REPLIES 63
Message 2 of 64
Perhed
in reply to: Rafal.Gaweda

Hello!

 

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

How should i use the macro?

 

/Per

Message 3 of 64
Rafal.Gaweda
in reply to: Perhed

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
Message 4 of 64
Perhed
in reply to: Rafal.Gaweda

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

 

/Per

Message 5 of 64
Rafal.Gaweda
in reply to: Perhed

Try: 

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

2. Check \ set UAC :

UAC.jpg

 



Rafal Gaweda
Message 6 of 64
Perhed
in reply to: Rafal.Gaweda

This gives the same error.

Message 7 of 64
Rafal.Gaweda
in reply to: Perhed

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
Message 8 of 64
Rafal.Gaweda
in reply to: Rafal.Gaweda

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

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?

Message 10 of 64

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
jamalsid
in reply to: Rafal.Gaweda

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


@rg_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


 

Message 12 of 64
Rafal.Gaweda
in reply to: jamalsid
Message 13 of 64

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

Message 14 of 64

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
Message 15 of 64

Hello,

 

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

 

Thank you!

Message 16 of 64

Robot -> Nodes table


Rafal Gaweda
Message 17 of 64

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

Message 18 of 64

Example attached.



Rafal Gaweda
Message 19 of 64
mgaafar
in reply to: Rafal.Gaweda

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? 

Message 20 of 64
Rafal.Gaweda
in reply to: mgaafar

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report