Robot-API: create load 3 points surface

Robot-API: create load 3 points surface

hvdsidf
Enthusiast Enthusiast
1,846 Views
13 Replies
Message 1 of 14

Robot-API: create load 3 points surface

hvdsidf
Enthusiast
Enthusiast

Hi,

 

I'd like to create record type load 3 Points Surface with API (avec VBA):

 

Capture 1.JPG

I don't know how to set the 3 points (I_3PRV_N1, I_3PRV_N3, I_3PRV_N3). I have tried to give the node number but not work.

Please help me.

 

Otherwise, I have tried to do this manually, it doesn't work neither, see the message below:

Capture.JPG

 

Thanks in advance for your reply.

 

HUA Van Dong

Structures Ile-de-France

 

0 Likes
Accepted solutions (1)
1,847 Views
13 Replies
Replies (13)
Message 2 of 14

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @hvdsidf

 

Please take a look at attached example macro



Rafal Gaweda
Message 3 of 14

hvdsidf
Enthusiast
Enthusiast

Hi Rafal,

 

 

Thank you very much for your reply. It's clair and word your exemple.

 

best regards

HUA Van Dong

0 Likes
Message 4 of 14

hvdsidf
Enthusiast
Enthusiast

Hi Rafal,

 

I have tested your exemple, it create well the contour loads, but when the model is calculated, these loads are not taken in account (with message error).

In fact, it seems that the contour is not closed.

And when I closed the contour manually in Robot Interface (right click on the load and using the property of load), it works well.

 

So I think that we have to add a code to close the contour, but how to do?

 

Thanks for your help,

HUA van Dong

Structures Ile-de-France

0 Likes
Message 5 of 14

Rafal.Gaweda
Autodesk Support
Autodesk Support

@hvdsidf

 

Example macro works with no problem (check case number, panel number, panel geometry, contour points coordinates)

 

3p.jpg



Rafal Gaweda
0 Likes
Message 6 of 14

hvdsidf
Enthusiast
Enthusiast

Hi Rafal,

 

The macro create the contour load as we can see before Robot calculate.

But when Robot calculate, it dones'nt recognize this contour load (message error): I attache here the model in which there are the contour load created by API.

 

As I haved explained before, I have to close the contour load manually with Robot Interface (right click on the load and using the property of load), Robot recognize this contour load.

 

So I think that we have to add a code in API to close the contour, but how to do this?

 

Thanks for your help,

HUA van Dong

Structures Ile-de-France

0 Likes
Message 7 of 14

Rafal.Gaweda
Autodesk Support
Autodesk Support

HI @hvdsidf

 

This works like here on your file:

 



Rafal Gaweda
0 Likes
Message 8 of 14

hvdsidf
Enthusiast
Enthusiast

Hi Rafal,

 

Have you tested the origin of my model? Is-there the message error?

 

If not, you can see the video of sreencast that I test yout API, you will see the error message (and there are NO REACTION in theses cases, it means that the loads are not taken in account)).

When I close manual the contour load, there is no longer error message and there are REACTION.

 

here is the video: http://autode.sk/2qGpR4u

 

But I'd like to close the contour load it with API.

 

Thanks in advance,

 

0 Likes
Message 9 of 14

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @hvdsidf

 

Yes, I have seen message in your original file.

That's why I deleted these two records from Loads table before recording my video



Rafal Gaweda
0 Likes
Message 10 of 14

hvdsidf
Enthusiast
Enthusiast

Hi Rafal,

 

But do you know why there are the message error in my case (you can see them in my video) and the contour loads creating by API are not taken in account?

 

Thanks

0 Likes
Message 11 of 14

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @hvdsidf

 

 

My mistake I posted different file version than I used.

One line in missing.

 

Add it to the code:

 

rec_1.SetVector 0, 0, 1

 



Rafal Gaweda
0 Likes
Message 12 of 14

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @hvdsidf

 

Correct example attached.



Rafal Gaweda
0 Likes
Message 13 of 14

hvdsidf
Enthusiast
Enthusiast

Hi Rafal,

 

It works well now.

Thank you very much.

 

So, it is neccessary to add the below (for load in direction Z)

recContour.SetVector 0, 0, 1

 

Thousand thanks,

HUA Van Dong

0 Likes
Message 14 of 14

daniilZSZ8N
Participant
Participant

For those who are trying to find how to do it in python, here is the example

	load_case = 2 # case number 1 should exist or it will fail
	m = structure.Cases.Delete(load_case) #delete the case to avoid doubling when reload
	#create case
	case_rob_type = IRobotCaseNature.I_CN_WIND
	case = structure.Cases.CreateSimple(load_case,load_name, case_rob_type, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR)
		
		
	loads =[]
	
	#create load
	load_nmb = case.Records.New(IRobotLoadRecordType.I_LRT_IN_3_POINTS)
	load = structure.Cases.Get(load_case).Records.Get(load_nmb)

	load.SetPoint(1,4.67, -5.00, 0.00) # point A, X,Y,Z
	load.SetPoint(2,2.40, -5.00, 2.67) # point B, X,Y,Z
	load.SetPoint(3,4.67, -2.72, 2.67) # point C, X,Y,Z

	load.SetValue(IRobotIn3PointsRecordValues.I_3PRV_LOCAL_SYSTEM,1) #1 means True
	load.SetValue(IRobotIn3PointsRecordValues.I_3PRV_PZ1,1000) #in Pa
	load.SetValue(IRobotIn3PointsRecordValues.I_3PRV_PZ2,2000)
	load.SetValue(IRobotIn3PointsRecordValues.I_3PRV_PZ3,3000)	

	loads.append(load)
	#apply load
	load.Objects.FromText(surfaces[0].Number)
0 Likes