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

Creo 7.0 부터 "regen_failure_handling" 옵션을 사용 할 수 없습니다

by ToolBOX01 2024. 4. 11.
반응형

Creo 7.0 부터 재생성 (Regeneration)은 " No Resolve Mode"를 설정하여 사용 할수 없습니다. 기본 값은 "Resolve Mode" 입니다. VBA 에서 Creo Parametric이 No-Resolve 모드에서 실행 중인 경우는 IpfcXToolkitBadContext를 발생시킵니다. 

 

regen_failure_handling > Resolve Mode 구동 이미지 입니다

[Resolve Mode]

왜 PTC는 " No Resolve Mode"를 사용 못하게 하는가? 실패한 Feature가 있으면 WC에 Check - in 할수 없습니다

 

 

⊙ Creo Parametric에서 기능이 실패한 모델의 저장/업로드/체크인을 방지하는 방법

  1. 실패한 기능이 있는 모델의 저장 / 업로드 / 체크인을 방지하는 방법
  2. 어셈블리의 안정성과 성능이 중요합니다.
  3. 대규모 어셈블리 범위에서 모델에 실패한 피쳐가 있으면 검색 시 안정성과 성능이 크게 저하될 수 있습니다.
  4. 일부 모델에 실패한 기능이 포함된 경우 저장 작업을 방지하는 방법은 무엇입니까 ?

config.pro에서 Allow_save_failed_model no를 설정 합니다.
위 옵션을 사용하면 실패한  기능이 포함된 모델에서 저장을 시도하는 경우 :
1. 사용자 인터페이스에서 다음 충돌 창이 열립니다.
2. 해결이 되지 않으면, 모델이 저장되지 않았습니다.

regen_failure_handling

  •  Creo 7 이상부터는  regen_failure_handling 옵션이 더 이상 사용되지 않으므로 사용하면 안 됩니다.
  • Creo 10.0에서는 설정 기능이 제거 되었습니다.


regen_failure_handling 옵션을 사용 못하면 Feature 재생성 및 삭제 기능을 사용 할 수 없습니다.
PTC는 이 문제를 어떻게 해결 해 줄까요?

1.  Feaure 재생성 (Regeneration)

  Dim Solid as ipfcSolid
  Dim RegenInstructionsCreate As New CCpfcRegenInstructions
  Dim regenInstructions As IpfcRegenInstructions
    
  set Solid = model
  Set regenInstructions = RegenInstructionsCreate.Create(False, False, Nothing)
  regenInstructions.ResolveModeRegen = True
  regenInstructions.UpdateInstances = True
  
  Call Solid.Regenerate(regenInstructions)

 

2.  Feaure 삭제 (Delete)

ExecuteFeatureOps()는 해결 모드가 없을 때 XToolkitBadContext를 계속 발생시킵니다.
Creo Parametric 7.0 릴리스부터 해결 모드에서 모델을 재생성하는 기능이 더 이상 사용되지 않습니다. 
따라서  ExecuteFeatureOps()는  더 이상 작동하지 않습니다.

1) Mapkey

Feature를 삭제(deleting)하고 억제(suppressing)하려면 매크로를 사용하는 것도 해결 방법이 될 수 있습니다

어셈블리에서 구성 요소를 삭제하는 VB API용 샘플 코드

Dim compIds As Iintseq = New Cintseq
compIds.Append(66)
compIds.Append(43)

Dim currentAssembly As IpfcAssembly = TryCast(session.CurrentModel, IpfcAssembly)
Dim compPath As IpfcComponentPath = (New CMpfcAssembly).CreateComponentPath(currentAssembly, compIds)
Dim componentSel As IpfcSelection = (New CMpfcSelect).CreateComponentSelection(compPath)

Dim selectionBuffer As IpfcSelectionBuffer = session.CurrentSelectionBuffer
selectionBuffer.Clear()
selectionBuffer.AddSelection(componentSel)

Dim macroString As String = "~ Command `ProCmdEditDelete`;~ Activate `del_sup_msg` `ok`;"
session.RunMacro(macroString)

 

2) Pro/Toolkit DLL

PTC가 DLL을 제공 하지 않습니다.

 

CS96148 - VBA Example to Load a Task based Pro/Toolkit DLL and execute the Exported function using ExecuteFunction() method

Article - CS96148 VBA Example to Load a Task based Pro/Toolkit DLL and execute the Exported function using ExecuteFunction() method Modified: 11-Nov-2016    Applies To Pro/ENGINEER and Creo Elements/Pro Wildfire 4.0 to Wildfire 5.0Creo Parametric 1.0 to

www.ptc.com