document.ProjectLocations can't insert new project location

document.ProjectLocations can't insert new project location

Anonymous
Not applicable
377 Views
1 Reply
Message 1 of 2

document.ProjectLocations can't insert new project location

Anonymous
Not applicable

Hi,

 

When i use document.ProjectLocations to insert new project location. i get error that the collection is read only.

i know the document.ProjectLocations is read only property but i use document.Projectlocations.Insert(newProjectLoction). 

 

Why i get this error?

can anybody help me

Regards,

H.M

0 Likes
Accepted solutions (1)
378 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni
Accepted solution

According to the documentation, the ProjectLocations property enables you to retrieve all the project locations associated with this project. 

 

https://www.revitapidocs.com/2021.1/87be3885-b1aa-ba8c-f82e-a5a0f7455c3a.htm

 

That is different from adding a new location; so, according to the documentation, what you are trying to do is not supported. At least not via this property.

 

Actually, after a quick web search, I found no hint that it is possible to add a project location programmatically at all.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes