Skip to main content
14-Alexandrite
Aug 15, 2024 10:33 AM UTC
Question

skeleton

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.

 

 

6 replies

FV_01
Aug 15, 2024 10:09 PM UTC

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

Translate
14-Alexandrite
Aug 21, 2024 7:47 PM UTC

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;
}
Translate
RPN
18-Opal
Aug 30, 2024 2:17 PM UTC

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

Translate
14-Alexandrite
Aug 30, 2024 9:47 PM UTC

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?

Translate
AndrewK
Community Manager
Aug 26, 2024 11:25 AM UTC

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!

Translate