AS API positioning profile with refaxis / offset

AS API positioning profile with refaxis / offset

Anonymous
Not applicable
1,113 Views
5 Replies
Message 1 of 6

AS API positioning profile with refaxis / offset

Anonymous
Not applicable

Hi, everybody.

 

I am trying to put the "refaxis" off the cross-section, so I followed this topic:

https://forums.autodesk.com/t5/advance-steel-forum/as-api-profile-positioning-with-refaxis/td-p/8447...

 

But I only managed to set the axis to the corner of the profile section using the first line of the following code:

myBeam.RefAxis = Beam.eRefAxis.kLowerLeft;
myBeam.Offsets.Set(10, 30);

 

I need an offset and it seems "myBeam.Offsets.Set(10, 30)" is not working!

Any Ideas?

0 Likes
1,114 Views
5 Replies
Replies (5)
Message 2 of 6

ChristianBlei
Advisor
Advisor

Hi,

 

the offsets is a 2d vector.

public Autodesk.AdvanceSteel.Geometry.Vector2d Offsets { get; set; }
    Member von "Autodesk.AdvanceSteel.Modelling.Beam"

so try

Vector2d v= new Vector2d(20,30)
myBeam.Offsets.Set(v);


HTH,
Christian Blei

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks a lot ChristianBlei,

Actually "Offsets.Set" has no overloads for accepting a Vector2d, but your
answer gave me the clue to solve the problem as follow:

Vector2d v = new Vector2d (20, 30);
myBeam.Offsets = v;
0 Likes
Message 4 of 6

ChristianBlei
Advisor
Advisor
Hi,

isn't the type of Beam.Offsets just Vector2d?
Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 5 of 6

Anonymous
Not applicable

It is.

I meant the "Set" function only accepts two "double" arguments, not a "Vector2d". So, I assigned the vector2d to the "OffSets" directly without using the "Set" method.

In fact, the code below is not working as it is expected to accept two doubles and create a "Vector2d" and assign it to the "OffSets" method

myBeam.OffSets.Set(double x, double y);

But instead, as you mentioned this works:

Vector2d v = new Vector2d(double x, double y);
myBeam.OffSets = v;
0 Likes
Message 6 of 6

ChristianBlei
Advisor
Advisor

Hi,

 

here are explanations for the set and get accessors of properties in C#. you may have a look.

Happy coding and a happy 2020!

 

Christian Blei

 

 

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes