Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

jlink, assembly

maykel

New member
Hello,

I'm a college student from Poland and I need your help. I have to write a synchronous java application. I need it to be able to import the list of parts from the assembly tree to jlist (or something similar), and then after clicking on a certain part it has to display the part parameters and allow me to alter the values. Then the assembly is refreshed. Is this even possible? What method should I use? If you have any ideas for the code to use, please post it. I`m Java newbie. Any help would be much appreciated. Thanks!
 
maykel,


Read the J-Link API Wizard located here: <Pro Loadpoint>\jlink\jlinkdoc\index.htm. Yes this can be done very easily with J-Link. I am a Pro/TOOLKIT programmer but I know this can be accomplished with J-Link.
 
williaps thanks for reply.
I have foud something like this :
Code:
try {
komponenty =  assembly.ListFeaturesByType(Boolean.TRUE, FeatureType.FEATTYPE_COMPONENT);
  for (int i = 0; i < komponenty.getarraysize(); i++){
  String komponent = komponenty.get(i).GetName().toString();
  
stringseq sekwencja = stringseq.create(); 
sekwencja.append(komponent);
  
  }
}
catch (jxthrowable x){
  
}

is this method responsible for showing part names?
is there any possible way to export them (names) to jlist or something like this?
I`am totally novice. Sorry for stupid questions
smiley2.gif
 
maykel,


Yes this function is responsible for showing component names. You see, in an assembly, each featrue (ListFeaturesByType) is actually a component of that assembly. In a part a feature is an extrusion, surface, sketch, etc... That is why the function ListFeaturesByType was passed the feature type of FeatureType.FEATTYPE_COMPONENT. Then in the loop the GetName function is called to retrieve the name of the component.
 
I'm chasing a related problem. However I'm getting stuck assigning
"assembly" a value. I want to take a string that holds the name of an
assembly and assign it to the "assembly" variable. In other words how
do I set the "assembly" variable a value?



Also does an assembly have to be in the session to be read by JLink?
 

Sponsor

Back
Top