if you’re looking for the project address, project name, project number, client name, and so on in the RVT, we can do the following in viewer.
async function searchAsync(model, text, attributeNames, options) {
return new Promise((resolve, reject) => {
model.search(text, resolve, reject, attributeNames, options);
});
}
async function getBulkProperties2Async(dbIds, options, model) {
return new Promise((resolve, reject) => {
model.getBulkProperties2(
dbIds,
options,
(result) => resolve(result),
(error) => reject(error)
);
});
}
async function getProjectInfo(model, category = 'Project Information') {
return new Promise(async (resolve, reject) => {
const found = await searchAsync(model, category, ['Category'], { searchHidden: true });
if (!found || found.length <= 0) return reject('Project Information not found');
const result = await getBulkProperties2Async(found, { propFilter: ["Organization Name", "Organization Description", "Building Name", "Author", "Project Issue Date", "Project Status", "Client Name", "Project Address", "Project Name", "Project Number"] }, model);
if (!result) return reject('Project Information not found');
const data = result[0];
return resolve(data);
});
}
await getProjectInfo(model);
