본문 바로가기
  • 환영 합니다 ! Welcome!
VBA For Creo

# 1 3D Step 파일 변환 프로그램

by ToolBOX01 2021. 2. 9.
반응형

Part 파일을 Step 파일로 변환 하는 기능. 3D 모델을 OPEN 하고, 프로그램을 실행 한다. 엑셀 Cells (2,"b")에 이름 변경할 파일 이름을 적는다.  Step 파일의 환경 설정은 config. pro 파일에 정의 한다.

VBA 프로그램에서는 솔리드만 변환 하고, 어셈블 파일은 단일 파일로 변환 한다.

 

 

Data Exchange Profiles

Creo Parametric 4.0에서 데이터 교환을위한 내보내기 프로필을 설정하는 방법 Creo Parametric 옵션 대화 상자에서 열기, 가져 오기 및 내보내기를 위한 데이터 교환 프로파일을 쉽게 관리 할 수 있

idt21c.tistory.com

 

▶ STEP 파일 옵션 정의

 

    Dim oFlagscreate As New CCpfcGeometryFlags
    Dim Flags As IpfcGeometryFlags
    Set Flags = oFlagscreate.Create
    Flags.AsSolids = True
    Dim oSTEP3DExportInstructionsCreate As New CCpfcSTEP3DExportInstructions
    Dim oStepinstructions As IpfcSTEP3DExportInstructions
    Set oStepinstructions = oSTEP3DExportInstructionsCreate.Create(EpfcAssemblyConfiguration.EpfcEXPORT_ASM_SINGLE_FILE, Flags)

    

 

변환 실행 코딩

Call oModel.Export(oStepfileName + ".stp", oStepinstructions)

 

프로그램

 


Sub exportstep()

    Dim asynconn As New pfcls.CCpfcAsyncConnection
    Dim conn As pfcls.IpfcAsyncConnection
    Set conn = asynconn.connect("", "", ".", 5)
    Dim oSession As IpfcBaseSession
    Set oSession = conn.Session
    Dim oModel As IpfcModel
    Set oModel = oSession.CurrentModel
    
    Dim oStepfileName As String
    oStepfileName = Cells(2, "b")
           
          
    Dim oFlagscreate As New CCpfcGeometryFlags
    Dim Flags As IpfcGeometryFlags
    Set Flags = oFlagscreate.Create
    Flags.AsSolids = True
    Dim oSTEP3DExportInstructionsCreate As New CCpfcSTEP3DExportInstructions
    Dim oStepinstructions As IpfcSTEP3DExportInstructions
    Set oStepinstructions = oSTEP3DExportInstructionsCreate.Create(EpfcAssemblyConfiguration.EpfcEXPORT_ASM_SINGLE_FILE, Flags)

    
    Call oModel.Export(oStepfileName + ".stp", oStepinstructions)
    
    'Disconnect with Creo
    conn.Disconnect (2)
    
End Sub

 

 

 

 

- YouTube

© 2021 Google LLC CEO: 선다 피차이 주소: 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA. 전화: 080-822-1450(무료)

www.youtube.com

 

 

step file export V2.xlsm
0.02MB

 

 

비즈니스 문의 : lionkk@idt21c.com


 

'VBA For Creo' 카테고리의 다른 글

엑셀 VBA For Creo 파일 변환  (0) 2021.02.10
# 2 2D pdf 파일 변환 프로그램  (0) 2021.02.10
Feature Delete - V2  (0) 2021.02.09
자동화 오류 - 2147417851 (80010105)  (0) 2021.02.08
Feature Delete - V1  (0) 2021.02.07