Skip to main content
14-Alexandrite
August 15, 2024
Question

skeleton

  • August 15, 2024
  • 3 replies
  • 1750 views

Hello,

I have multiple skeleton in my assembly. I use to ProAsmSkeletonGet() to retrieve skeleton as ProMdl Skel. It retrieves first skeleton from model. I want to get also the next skeletons to perform operations on feature in it. Can anyone one suggest how do I retrieve second skeleton with help of ProAsmSkeletonGet() or any similar function to perform operation on feature in other skeleton in same assembly.

 

 

3 replies

August 15, 2024

there is a function ProMdlIsSkeleton - the user guide has a sample code TestAsm.c - copy/paste

14-Alexandrite
August 21, 2024

To get all skeletons, traverse your assembly (only one level or recursively) using ProSolidFeatVisit(): use the following filter function to visit only components that are skeletons:

 

ProError MdlSkelettonFind_FeatFiltAct(ProFeature* pFeature, ProAppData pAppData){
	ProError			iStatus = PRO_TK_CONTINUE;	//	Default filter result: deny visiting this feature (filtered out)
	ProError			pErr;
	ProFeattype			pFeattype;
	ProFeatStatus		pFeatStatus;
	ProMdl				pModel;
	ProBoolean			bIsSkeleton;
	
	if (pFeature->type == PRO_FEATURE){
		pErr = ProFeatureTypeGet(pFeature, &pFeattype);
			if (pErr != PRO_TK_NO_ERROR) { return PRO_TK_CANT_ACCESS; }
		if (pFeattype != PRO_FEAT_COMPONENT){	//	Feature is a component? 
			return iStatus;						//	Skip non-component features
		}else{
			pErr = ProFeatureStatusGet(pFeature, &pFeatStatus);
				if (pErr != PRO_TK_NO_ERROR) { return PRO_TK_CANT_ACCESS; }

			//	Optional: filter for features that are in the state "active" or "active but unregenerated" (skip visiting others)
			if ((pFeatStatus != PRO_FEAT_ACTIVE) && (pFeatStatus != PRO_FEAT_UNREGENERATED)){
				return iStatus;					//	Skip feature
			}

			//	Filter for skeletons
			pErr = ProAsmcompMdlGet(pFeature, &pModel);
				if (pErr != PRO_TK_NO_ERROR) { return PRO_TK_CANT_ACCESS; }
			pErr = ProMdlIsSkeleton(pModel, &bIsSkeleton);
				if (pErr != PRO_TK_NO_ERROR) { return PRO_TK_CANT_ACCESS; }
			if (bIsSkeleton == PRO_B_TRUE){
				iStatus	= PRO_TK_NO_ERROR;			//	Allow visiting this feature
			}
		}
	}

	return iStatus;
}
RPN
18-Opal
August 30, 2024

Another Code sample 😀 (Und einen netten Gruß!)

 

# Return all active Skeletons by name and the Component/Feature ID

# in the given assembly

# Defaults to Status Active

proc GetSkeletons {Assy} {

  set retData [list]

  foreach {model cid} [ps_visit components -model $Assy] {
    if {[ps_model is_skeleton -model $model] } {
      lappend retData [list $model $cid]
    }
  }

  return $retData

}

doc00674.png

# Call GetSkeletons ASM0001.ASM

# will return

# => retVals {ASM0001_SKEL0001.PRT 42}

 

# ps_visit components will return
# => ASM0001_SKEL0001.PRT 42 BOX.PRT 41

14-Alexandrite
August 30, 2024

Interesting! In what environment can this (i assume it is Tcl) code be used/run? Do you use C wrapper tools to utilize TOOLKIT API and compile Tcl-code to a TOOLKIT-DLL?

AndrewK
Community Manager
August 26, 2024

Hi @Marcusanthony,


I wanted to follow up with you on your post to see if your question has been answered. If so, please mark the appropriate reply as the Accepted Solution for the benefit of other members who may have the same question.

Of course, if you have more to share on your issue, please let the Community know. 

 

Thanks!