Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Application.new referenceArray Vs ReferenceArray?

1 REPLY 1
Reply
Message 1 of 2
Moustafa_K
243 Views, 1 Reply

Application.new referenceArray Vs ReferenceArray?

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
Tags (1)
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Moustafa_K

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community