API : creating dimensionning families using the API and VBA

API : creating dimensionning families using the API and VBA

youssef_taamallahCZ4NM
Participant Participant
590 Views
5 Replies
Message 1 of 6

API : creating dimensionning families using the API and VBA

youssef_taamallahCZ4NM
Participant
Participant

hi ,
im new to using the api , and so far im meeting a huge issue with trying to create dimensionning families and i cant seem to find a solution for it . 

 

If Not RobApp.Visible = True Then
Set RobApp = Nothing
MsgBox "Ouvrez une session de Robot PCI "
Exit Sub

End If

 

RobApp.Project.Structure.Groups.Create I_OT_BAR, "GR 2", "1 2"
idx = RobApp.Project.Structure.Groups.Find(I_OT_BAR, "GR 2")


End Sub

0 Likes
Accepted solutions (1)
591 Views
5 Replies
Replies (5)
Message 2 of 6

Stephane.kapetanovic
Mentor
Mentor

hi @youssef_taamallahCZ4NM 

the groups of bars and those corresponding to the steel design are not the same.

Find a copy of "Robot API SteelDesign.pdf" and take a look to this following link

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-get-data-to-create-dimensioning-g...

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 3 of 6

youssef_taamallahCZ4NM
Participant
Participant

i cant seem to find how in the documentation though , im not familiar enough with this i guess . can you point to me where to look for exactly ? @Stephane.kapetanovic  , like a simple exemple  ?

0 Likes
Message 4 of 6

Romanich
Mentor
Mentor

Hi @youssef_taamallahCZ4NM ,

 

I think you should store the group first:

Dim RGR As robotgroup

''your code'''

Set RGR = RobApp.Project.Structure.Groups.Get(I_OT_BAR, idx)
RGR.Store

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


Message 5 of 6

youssef_taamallahCZ4NM
Participant
Participant

i was able to make it happen using this code :

Dim RDmServer As RDimServer
Dim RDmStream As RDimStream
Set RDmServer = RobApp.Kernel.GetExtension("RDimServer")
Dim RDmGrp1 As RDimGroup 'object of the 1st group
Dim RDmGrpProfs As RDimGrpProfs 'collection of sections for design
Dim GroupNo As String ' group’s number


RDmServer.Mode = RobotOM.IRDimServerMode.I_DSM_STEEL
Set RDmGrps = RDmServer.GroupsService



RDmServer.Mode = RobotOM.IRDimServerMode.I_DSM_STEEL
Set RDmGrps = RDmServer.GroupsService
GroupNo = Range("B" & I)
Set RDmGrp1 = RDmGrps.New(0, GroupNo) ' creates a new Object of the group with default settings

RDmGrp1.Material = "ACIER E28 D9000 ACIER E28 D9000"
RDmGrp1.Name = Range("D" & I)
Set RDmStream = RDmServer.Connection.GetStream
RDmStream.Clear
RDmStream.WriteText (Range("E" & I)) 'list of members
RDmGrp1.SetMembList RDmStream
Set RDmGrpProfs = RDmServer.Connection.GetGrpProfs
RDmGrp1.SetProfs RDmGrpProfs
RDmGrps.Save RDmGrp1

But im having issues defining the right material for my groupe .

I bascially need to ask robot to use either S235 or S355 steel .


but the specific line that makes this happen in the documentation is :

RDmGrp1.Material = "ACIER E28 D9000 ACIER E28 D9000"

this doesnt seem to work ,  does anyone know how i can make it happen ?

Thanks a lot for the advices .

0 Likes
Message 6 of 6

Accepted solution

hi @youssef_taamallahCZ4NM 

you are right, RDimGroup accept a property Material in string format. 

if you have a material already created in your project nammed "S235" or "S355" for example, you can use it.

Best regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes