본문 바로가기
  • Welcome!
VBA, VB.NET For Creo

Creo] IpfcModel

by ToolBOX01 2025. 2. 1.
반응형

□ 소개

현재 세션(Session)에 존재하는 모델(Model)의 정보를 지정하는 클래스입니다.

▷관련 클래스 및 메서드

이 인터페이스는 다양한 모델 관련 작업을 수행할 때 사용됩니다. 관련된 주요 메서드는 다음과 같습니다:

  • IpfcSolid
  • IpfcModel2D
  • IpfcBaseSession.ListModels() (세션에 있는 모델 목록 가져오기)
  • IpfcBaseSession.RetrieveModel() (모델 불러오기)
  • IpfcBaseSession.GetModel() (세션에서 특정 모델 가져오기)
  • IpfcBaseSession.GetModelFromDescr() (모델 디스크립터를 통해 모델 가져오기)
  • IpfcBaseSession.GetByRelationId() (관계 ID를 이용해 객체 가져오기)
  • IpfcBaseSession.CreateModelWindow() (새 모델 창 생성)
  • IpfcBaseSession.ImportNewModel() (새로운 모델 가져오기)
Dim BaseSession As IpfcBaseSession
Dim Model as IpfcModel

set Model = BaseSession.ListModels()

▷ 직접적인 부모 클래스

  • IpfcModelItemOwner
  • IpfcViewOwner
  • IpfcChild
  • IpfcActionSource
  • IpfcRelationOwner
  • IpfcParameterOwner
Dim Model as IpfcModel
Dim ModelItemOwner As IpfcModelItemOwner

set ModelItemOwner = Model

Property Descr as IpfcModelDescriptor

IpfcModelDescriptor란?
IpfcModelDescriptor는 Creo Parametric과 같은 CAD 소프트웨어의 API에서 사용되는 객체(또는 데이터 구조체)로, 모델(예: 부품, 어셈블리, 도면 등)에 대한 정보를 기술하는 “모델 설명자” 역할을 합니다.

IpfcModelDescriptor 주요 역할 및 속성

모델 식별:
모델의 이름, 형식(예: 부품, 어셈블리 등) 및 위치(파일 경로 등)와 같은 기본 정보를 포함합니다.

모델 열기/검색:
이 설명자를 이용하여 API 호출 시 특정 모델을 열거나, 검색하고 불러올 수 있습니다. 즉, IpfcModelDescriptor는 “어떤 모델을” 다루어야 하는지에 대한 정보를 제공함으로써 모델 객체를 식별하고, 적절한 작업(예를 들어, 수정, 분석, 저장 등)을 수행할 수 있도록 도와줍니다.

버전 관리 및 기타 속성:
경우에 따라 모델의 버전, 수정 기록, 기타 부가적인 메타데이터를 포함할 수 있습니다.

code

Dim BaseSession As IpfcBaseSession
Dim Model As IpfcModel
Dim ModelDescriptor As IpfcModelDescriptor

set Model = BaseSession.CurrentModel
set ModelDescriptor = Model.Descr

debug.print ModelDescriptor.FileVersion
debug.print ModelDescriptor.Path
debug.print ModelDescriptor.Type

 

IpfcModelDescriptor는 CAD 환경에서 모델을 식별하고 관리하는 데 중요한 역할을 하며, 사용자가 모델 관련 작업(열기, 저장, 수정 등)을 수행할 때 필요한 핵심 정보를 담고 있습니다.

아래 사이트를 방문 하여 "IpfcModel"의 다양한 기능을 확인 하십시요

 

Model Information - IpfcModel

□ IpfcModel.IsCommonNameModifiable() 모델 일반 이름(IpfcModel.CommonName)을 수정할 수 있는지 식별합니다. FunctionIsCommonNameModifiable () as Boolean Option Explicit Sub commonbool() On Error GoTo RunError Dim asynconn As New pfcls.CCp

tool-2020.tistory.com

by korealionkk@gmail.com