!******************************************************************************* ! ! UCMSOLID.MAC ! ------------ ! ! Description ! ----------- ! This macro searches the database for individual parts and assigns them to ! named components based on their constituent solid model entities. ! ! Revision History ! ---------------- ! 16/11/04 LC Initial release. ! 23/11/04 LC Added CMPLOT to end of macro. ! ! Usage ! ----- ! Invoke the macro by typing the command: ! ! UCMSOLID,IVOLU,IAREA,ILINE,IKP ! ! where: IVOLU=1 if volume components are to be created. ! IAREA=1 if area components are to be created. ! ILINE=1 if line components are to be created. ! IKP =1 if keypoint components are to be created. ! ! The default is to create all four types of component. ! ! Output ! ------ ! The macro creates components with the following naming convention: ! ! Cn_X ! ! where: n is the part number. ! X is "K" to indicate a keypoint component, ! "L" to indicate a line component, ! "A" to indicate an area component, ! "V" to indicate a volume component. ! !******************************************************************************* *if,arg1,eq,0,and,arg2,eq,0,then *if,arg3,eq,0,and,arg4,eq,0,then arg1=1 arg2=1 arg3=1 arg4=1 *endif *endif allsel *get,nokp_,kp,,count *if,nokp_,gt,0,then more_kps_=1 i_=0 *dowhile,more_kps_ /gopr i_=i_+1 *get,kpmin_,kp,,num,min ksel,s,,,kpmin_ nokps_=1 continue_=1 *dowhile,continue_ /gopr lslk *get,nolines_,line,,count *if,nolines_,ne,0,then ksll *endif *get,nokps_new_,kp,,count *if,nokps_new_,eq,nokps_,then continue_=0 *else nokps_=nokps_new_ *endif *enddo asll *get,noareas_,area,,count *if,noareas_,gt,0,then allsel,below,area *endif vsla *get,novolus_,volu,,count *if,novolus_,gt,0,then allsel,below,volu *endif cm,c%i_%_k,kp *get,nolines_,line,,count *if,nolines_,gt,0,then cm,c%i_%_l,line *endif *get,noareas_,area,,count *if,noareas_,gt,0,then cm,c%i_%_a,area *endif *get,novolus_,volu,,count *if,novolus_,gt,0,then cm,c%i_%_v,volu *endif allsel *do,j_,1,i_,1 cmsel,u,c%j_%_k *enddo *get,numkp_,kp,,count *if,numkp_,eq,0,then more_kps_=0 *endif *enddo cmsel,all allsel *do,j_,1,i_,1 *if,arg1,ne,1,then cmdele,c%j_%_v *endif *if,arg2,ne,1,then cmdele,c%j_%_a *endif *if,arg3,ne,1,then cmdele,c%j_%_l *endif *if,arg4,ne,1,then cmdele,c%j_%_k *endif *enddo cmplot *else *msg,error No solid model exists. *endif *del,,prm_