$$345678901234567890123456789012345678901234567890123456789012345678901234567890 $$ 1 2 3 4 5 6 7 8 $$ $$ Model2View.grs To change objects from 'Model Dependent' to 'View Dependent $$ or vice versa. $$ Model -> View: Changes the selected objects to veiw depen- $$ dent (to the currently active view). $$ View -> Model: Changes the selected objects to model depen- $$ dent. $$ This program allows the manipulation of objects for special $$ purposes. There are max. 1000 objects selectable. $$ This source code is based on a GRIP program from UG with the $$ same name. $$ $$ History: $$ -------- $$ V1.00 / Pyramid Solutions / 18.09.03 First public release. $$ V1.01 / Pyramid Solutions / 03.11.03 Increased the max. amount of selecta- $$ ble objects to 1000. $$ $$ $$ $$ $$ ***************************** $$ * Declaration of variables: * $$ ***************************** $$ $$ Index: o = object variable $$ n = numerical variable $$ s = string variable $$ GRIPSW/DECLRV $$ $$ ENTITY/oObjects(1000) NUMBER/nLength,nI,nChar,nLang NUMBER/nResp,nMode,nCrsMd,nNum STRING/sLang(16),sLoCase(1),sUpCase(1) STRING/sTxt(60),sMenuTxt(4,40) $$ $$ $$ $$ ************ $$ * Program: * $$ ************ $$ $$ Prepare $$ ======= $$ If there is no active part $$ -------------------------- IF/&ACTPRT==1,JUMP/End: $$ $$ $$ Check the language setting for the user interaction $$ (Supported in this program: ENGLISH, GERMAN) $$ --------------------------------------------------- sLang=&LANG $$ Change the whole string to upper case characters nLength=LENF(sLang) DO/EDo01P:,nI,1,nLength,1 nChar=ASCII(sLang,nI) IFTHEN/nChar>=97 AND nChar<=122 sLoCase=CHRSTR(nChar) nChar=nChar-32 sUpCase=CHRSTR(nChar) sLang=REPSTR(sLang,sLoCase,sUpCase,nI) ENDIF EDo01P: $$ $$ Set a control value to switch to the current language IFTHEN/sLang=='GERMAN' nLang=1 ELSE nLang=0 ENDIF $$ $$ $$ $$ Main $$ ==== $$ Create a menu to select the dependency mode or a help text $$ ---------------------------------------------------------- Ret01M: IFTHEN/nLang==1 sTxt='Welchen Modus?' sMenuTxt(1)='Modell -> Ansicht' sMenuTxt(2)='Ansicht -> Modell' sMenuTxt(4)='Programm- Info' ELSE sTxt='Which mode?' sMenuTxt(1)='Model -> View' sMenuTxt(2)='View -> Model' sMenuTxt(4)='Program Info' ENDIF sMenuTxt(3)='-' CHOOSE/sTxt,sMenuTxt,nResp $$ 1=Back / 2=Cancel / 3= / 4= / 5=Option 1 / 6=Option 2 etc. JUMP/End:,End:,,,Nxt02M:,Nxt02M:,,Nxt01M:,nResp $$ $$ Nxt01M: $$ $$ Display help text $$ ----------------- IFTHEN/nLang==1 PRINT/'' PRINT/'-----------------------------------------------' PRINT/'Model2View V1.01 / 03.11.03 / Pyramid Solutions' PRINT/'-----------------------------------------------' PRINT/'' PRINT/'Mit diesem Programm lassen sich Objekte von ' PRINT/'auf ändern und umgekehrt.' PRINT/'Es können max. 1000 Objekte ausgewählt werden.' PRINT/'' PRINT/'Modell -> Ansicht: Ändert die ausgewählten Objekte auf ansichtenab-' PRINT/' hängig (bezogen auf die gegenwärtig aktuelle An-' PRINT/' sicht).' PRINT/'Ansicht -> Modell: Ändert die ausgewählten Objekte auf modellabhän-' PRINT/' gig.' PRINT/'' PRINT/'' ELSE PRINT/'' PRINT/'-----------------------------------------------' PRINT/'Model2View V1.01 / 03.11.03 / Pyramid Solutions' PRINT/'-----------------------------------------------' PRINT/'' PRINT/'This tool allows the conversion of objects from to' PRINT/' and vice versa.' PRINT/'There are max. 1000 objects selectable.' PRINT/'' PRINT/'Model -> View: Changes the selected objects to view dependent (to the' PRINT/' currently active view).' PRINT/'View -> Model: Changes the selected objects to model dependent.' PRINT/'' PRINT/'' ENDIF JUMP/Ret01M: $$ $$ Nxt02M: $$ $$ Selection of the objects $$ ------------------------ $$ Mode: Model -> View = 1; View -> Model = 2 nMode=nResp-4 $$ $$ Save current cursor mode and set the cursor to select in any view nCrsMd=&VWCURS &VWCURS=&ANY $$ $$ Mask for all possible objects MASK/ALL $$ $$ Prompt the user to select max. 1000 objects Ret02M: IFTHEN/nLang==1 sTxt='Max. 1000 Objekte auswählen' ELSE sTxt='Select max. 1000 objects' ENDIF IDENT/sTxt,oObjects,CNT,nNum,nResp IFTHEN/nNum>1000 IFTHEN/nLang==1 sTxt='Zu viele Objekte ausgewählt' ELSE sTxt='Too many objects selected' ENDIF MESSG/sTxt JUMP/Ret02M: ENDIF $$ 1=Back / 2=Cancel / 3=OK JUMP/Ret02M:,Cln01S:,nResp $$ $$ $$ Conversion of the objects $$ ------------------------- IFTHEN/nMode==1 DO/EDo01M:,nI,1,nNum,1 VDEDIT/oObjects(nI),VIEW EDo01M: ELSE DO/EDo02M:,nI,1,nNum,1 VDEDIT/oObjects(nI),MODEL EDo02M: ENDIF $$ $$ JUMP/Cln01S: $$ $$ $$ $$ **************** $$ * Sub modules: * $$ **************** $$ $$ Error messages $$ ============== $$ - none - $$ $$ $$ $$ Clean up $$ ======== Cln01S: $$ Reset the cursor mode &VWCURS=nCrsMd JUMP/End: $$ $$ $$ $$ ******** $$ * End: * $$ ******** $$ End: HALT