Application.new referenceArray Vs ReferenceArray?

Application.new referenceArray Vs ReferenceArray?

Moustafa_K
Advisor Advisor
501 Views
1 Reply
Message 1 of 2

Application.new referenceArray Vs ReferenceArray?

Moustafa_K
Advisor
Advisor

i recently discovered that there are two Reference Arrays in the API,

the 1st:

ReferenceArray rArr = new ReferenceArray;

 

and the second:

Reference Array rArr = m_doc.Application.Create.NewReferenceArray();

 

Can any one inlight me what is the difference?

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
502 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

The simple answer is that there isn't is any difference at all. Many, if not all of the "New*' prefixed methods found in the Autodesk.Revit.Creation.Application class have either long existing or recently added equivalent constructor methods found within the class objects they return. Some of them are now becomming obsolete (NewLine, NewLineBound and NewLineUnbound for instance), which says to me that Autodesk are moving away from the monolithic factory class pattern in favour of localised factory methods and constructors. Which in my opinion is a very good thing.

 

To save yourself work in the future (See NewLine etc.) I'd go with the in-class constructor / factory method over the Creation.Application methods where possible. If someone more in the know has a differing view, then I am quite happy to be corrected.

0 Likes