모델 파일의 속성 조회
모델 파일에 포함된 속성 정보를 조회하는 방법에 대한 Plugin API 예제입니다.
모델 속성 정보 개요
REV / RVM 등의 CAD 모델을 VIZ 파일 형식으로 변환(로딩)할 때,
속성 정보가 존재하는 경우 해당 속성 정보는 VIZ 파일에 포함되어 변환됩니다.
REV / RVM 등의 CAD 파일 형식은
.att파일 형식의 별도 속성 정보 파일을 지원합니다.
전체 모델 속성 정보 조회
속성이 포함된 VIZ 파일을 조회할 경우,
모델 트리 → 속성 트리 화면에서 전체 모델의 속성 정보를 확인할 수 있습니다.

선택된 모델 속성 정보 조회 (UI)
속성이 포함된 VIZ 파일을 조회할 경우,
홈 → 개체 속성 화면에서 선택된 모델의 속성 정보를 확인할 수 있습니다.

선택 이벤트를 통한 속성 정보 조회
3D View에서 모델을 선택하면
이벤트 처리부에서 선택된 모델의 속성 정보를 조회할 수 있습니다.
이벤트 등록
private void GetProperty()
{
// 단일 모델 선택 이벤트
Connector.ObjectSelectedEvent += Connector_ObjectSelectedEvent;
// 복수 모델 선택 이벤트
Connector.ObjectsSelectedEvent += Connector_ObjectsSelectedEvent;
}
단일 모델 선택 시 속성 조회
private void Connector_ObjectSelectedEvent(object sender, ObjectSelectedEventArgs e)
{
// 선택된 모델이 없거나 선택 해제된 경우
if (e.Index < 0) return;
// Geometry 속성
ObjectPropertyVO prop = Connector.GetObjectProperty(e.Index, false);
Point3D centerPoint = prop.CenterPoint;
Point3D minPoint = prop.MinPoint;
Point3D maxPoint = prop.MaxPoint;
// 사용자 정의 속성
Dictionary<string, string> attributes = Connector.GetPropertyData(e.Index);
foreach (KeyValuePair<string, string> item in attributes)
{
string key = item.Key;
string value = item.Value;
}
}
복수 모델 선택 시 속성 조회
private void Connector_ObjectsSelectedEvent(object sender, EventArgs e)
{
List<NodeVO> items = Connector.GetSelectedObjects(false);
if (items.Count == 0) return;
// Geometry 속성
ObjectsPropertyVO prop = Connector.GetSelectedObjectsProperty();
Point3D centerPoint = prop.CenterPoint;
Point3D minPoint = prop.MinPoint;
Point3D maxPoint = prop.MaxPoint;
// 사용자 정의 속성
foreach (NodeVO item in items)
{
Dictionary<string, string> attributes = Connector.GetPropertyData(item.Index);
foreach (KeyValuePair<string, string> att in attributes)
{
string key = att.Key;
string value = att.Value;
}
}
}