(API) Excel VBA - Use FreeNum method and get load record num

(API) Excel VBA - Use FreeNum method and get load record num

cool.stuff
Collaborator Collaborator
1,021 Views
3 Replies
Message 1 of 4

(API) Excel VBA - Use FreeNum method and get load record num

cool.stuff
Collaborator
Collaborator

Hi!!

 

I have a structure with multiple simple cases. Each simple case has multiple load records of various types.

I am trying to create a new load record in existing simple cases but I want to use the freenum method to generate that load record and get its number.

So far I have this code:

 

 

Dim SimpleCase As RobotSimpleCase
Dim caseNum As Integer
caseNum = Cells(10, 2)
Set SimpleCase = robapp.Project.Structure.Cases.Get(caseNum)


SimpleCase.Records.New I_LRT_BAR_UNIFORM

Dim recordNum As Integer
recordNum = SimpleCase.Records.Count

Dim LoadRecord As RobotLoadRecord
Set LoadRecord = SimpleCase.Records.Get(recordNum)

 

 

But it is missing the FreeNumber method..

My idea is that with the FreeNumber method I can get the right load record, otherwise I dont know if I get it..

Can some help please?

Many thanks in advance!!! 🙂

0 Likes
Accepted solutions (1)
1,022 Views
3 Replies
  • VBA
Replies (3)
Message 2 of 4

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @cool.stuff 

 

There is no freenumber for load records.

You may use Records.New...

 



Rafal Gaweda
0 Likes
Message 3 of 4

cool.stuff
Collaborator
Collaborator

Many thanks for your answer @Rafal.Gaweda !! 🙂

 

So, if I use Count method, it will always give me the laod record that I create? Or is there another way of get the number of the last created load record?

 

Many thanks!! 🙂

0 Likes
Message 4 of 4

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @cool.stuff 

 

According to documentation Records.New returns record number.

 



Rafal Gaweda