Faceți căutări pe acest blog

joi, 9 mai 2019


    



       OPTIMIZAREA CURBELOR 
          2D SI 3D IN  CATIA
    


     In curand voi adauga un capitol, in care voi prezenta  o metoda de optimizare a curbelor 2D sau 3D. 
     Prin optimizare inteleg interpolarea unei curbe prin arce de conica, pentru a elimina punctele de inflexiune ale curbei respective. 
     Am dezvoltat aceasta procedura stiind ca un arc conica nu are puncte de inflexiune. Daca curba considerata are prin natura sa puncte de inflexiune, unele vor fi eliminate, iar cele ramase vor fi in punctele racordare dintre arcele de conica.

     Spre exemplificare,  mai jos prezint modificare unei curbe folosind metoda pe care o propun. 



Pe curand

sâmbătă, 10 ianuarie 2015

luni, 14 ianuarie 2013

Program ‘Checker_DOC_W&B’







UTILITARIAN ‘Checker_DOC_W&B’





0. INTRODUCTION

      The utilitarian ‘Checker_DOC_W&B is a postprocessor CATIA V5 , which has the input data a file of type CatProduct modeled for a project using CATIA V5 .

      The utilitarian ’Checker_DOC_W&B achieved in VISUAL FORTRAN under Windows . The utilita-rian controls  tree (the relationship assembly-component) for project analyzed, very useful, in the conceptual phase, but not only. For specific fields such as for example aircraft domain can be obtained aviation gravimetry database.

   

  A gravimetry database contains the information:

            - weight-

            - center of weight

            - moments of inertia              

   

            In CATIA V5 main entities are:

- Part is an entity modeled independently of any other entit

- Assembly is an entity that is modeled using Part and/or one or more ‘‘Assembly.

            The utilitarian ‘Checker_DOC_W&B’ has the input data two files obtained from CATIA V5 . First file which will be considered to have been of type ‘TREE’with the extension (*.bil) and and the second will be regarded as being of type ‘GRAVIM’ with the extension (*.grv).

            The utilitarian ‘Checker _DOC_W&B’ analyzes and signals:



1) If there are Assembly withoutPart;

2) If there is Part withoutAssembly;

3) If, for a Part used by a number of ‘n’ times (in different positions) in aAssembly, from the file

    ‘TREE’, have been modeled the same  number ‘n’ of Instance for Part from the file  ‘GRAVIM’.



             In some domains, as  of example aircraft, the uilitarian ‘Checker_Doc_W&B’ allows creation of the  database of the project  modelated in CATIA V5. The gravimetry database contains the information  for any assembly of the project, irrespective of the level of the subordination of the assembly(sub-assembly) in relation to the main(master) assembly, which level 0.



1.INITIAL DATA    

1.1 File ‘TREE’

             File ‘TREE’with the extension (*.bil), is to be obtained with the command ‘Bill of material...‘ submenu ‘Analyze‘ of main menu of the program CATIA V5 :




Figure 1

            This file represents the explosion(‘Boom’) modeled project in CATIA V5, in which they are supplied sequentially for each Assembly information for its components regardless of whether it is Assemblyor Part:

Type | Part/Assembly Number| Part/Assembly Description | Quantity

            In which:



Type                                                    - indicates if component is Part/Assembly

Part/Assembly Number                               - component code

Part/Assembly Description                            - name component

Quantity                                                              - the number of components used in the assembly



1.1 File ‘GRAVIM’

     The file ‘GRAVIM’ with extentia (*.grv) contains the information gravimetry for Instance of Part. For any Instance gravimetry informations are as follows:

    - density in kg/dm3

    - weight in kg

    - center weight (XCG , YCG , ZCG) in mm in relation to the main reference system

    - moments of inertia ( IXX, IYY, IZZ, , IXY, IXZ, IYZ) in kg/mm2

    

            In order to obtain file ‘Gravim‘ is acting icon:


or the window:




Figure 2



2. Generate files ‘TREE’ and ‘GRAVIM’

2.1 FILE ‘TREE’

             A file ‘TREE’  has the extension (*.bil) and will be used for define UserName.bil - UserName is given by the user. The file UserName.bil is generated by command ‘Bill of Material...‘ which activates the dialog box:


Figure 3

Where by pressing the button:


Box will be active dialog caseta:

 Figure 4



            From which the user will select in the order shown parameters and with the button:






In CATIA V5 a file obtained using command ‘Bill of Material...‘ can only be saved by default with the extension ‘txt’ , in the uilitarian ‘Checker_Doc_W&B’ is used with the extension (*.bil), later via command ‘rename‘ becomes UserName.bil . The file contains for each Assemblya sequence in which is initially displayed the code, followed by the data its components.

            Below shows the model of a file of type ‘TREE’, provided by CATIA V5 used in the utilita-rian ‘Checker_Doc_W&B’:





Figure 5



The file UserName.bil is ordered by a tree which we call vertical (vertical tree). In AAAA utility will use a tree which we call horizontal (horizontal tree). The two types of tree (vertical tree) and (horizontal tree) are shown in the following figure using mainly whole development A1, the level 0.




Figure 6



            In Figure 6 is shown on the horizontal tree as needed in utilitarian, vertical tree of CATIA V5 is defined on the whole A1levels since the level 0, are all components that have level 1. Next, take each set belonging to A1followed by components that have level 2 and so on.




2.2 FILE ‘GRAVIM’

            A file of type ‘GRAVIM’ has an extension (*. GRV) will be used with the name UserName. grv, UserName is given by the user. It is recommended that the file name type ‘GRAVIM’ to be identical to the file type ‘TREE’. The file ‘GRAVIM’ provides gravimetry data for any Part of file ‘TREE’as Instance.
            If a
Part is used by at least 2 times in a Assembly, the number on ‘QUANTITY’ should equal the number of Instance from file  ‘GRAVIM’ for this Part.
             As previously mentioned file type
‘GRAVIM’ is obtained from CATIA V5 through dialog box ‘Measure Inertia (Figure 2) or icon:


            After activating the button:




In necessary parameters are chosen in UserName.grv file as follows:







             After the selection presented with a touch of a button:






as text file( *.txt) which then using command ‘rename ‘ will be saved with the name UserName.grv director in the same likeness as the file UserName.bil . File structure UserName.grv type ‘GRAVIM’is shown below :


Figure 8

            Whether a code xxxxxxxx in file UserName.bil type ’Tree’ that is used by n’ times in assembly aaaaaaaa. For this Part in file UserName.grv type ‘GRAVIM’ is necessary to model a number nofInstance:

xxxxxxxx. i , (i =1, n)

3 . UTILITARIAN ‘Checker_DOC_W&B’.



            Utilitarian Checker_DOC_W&B is composed of
- program
GRVFOR  developed in VISUAL FORTRAN under WINDOWS
- program
START developed in VISUAL BASIC in file Sablon.xls  under Excel
Utilitarian Checker_DOC_W&B’ has the following flow:


 


Figure 9



3.1 PROGRAM GRVFOR



            Program GRVFOR was developed in VISUAL FORTRAN under WINDOWS as  \dialog box shown below:



Figure 10

            The program  GRVFOR  has as input data files UserName.bil  and UserName.grv obtained from file CatProduct in CATIA V5  for a project for which we want to use the utilitarian  ‘Checker_DOC_W&B‘. The file UsrName.csv is the output file for the program GRVFOR

           

            The program GRVFOR executes the following steps:

Step 1: enter maximum number of characters for Part/Assembly Number’, value default is 21

Step 2: opening and modifying files and UserName.grv and UserName.bil

Step 3: change file UserName.bil 

Step 4: change file UserName.grv

Step 5: creation file BilGrv

             

3.1.1 OPENING AND MODIFING FILE UserName.bil

The file UserName.bil consists of groups starting with a Assembly followed by information for each component (‘Part si/sau Assembly’). Each component (‘Part si/sau Assembly’) adds a Assemblyhighwhich includes. Data structure is formed following :



Assemblyhigh | Type | Part/Assembly Part / Part/Assembly Number | Quantity



that are stored in ComboBox103. From ComboBox103 select Assemblywhich are used by at least 2 ( Quantity > 1 ) in Assemblyhigh and then stored in the file ComboBox107 with UserName.bil position .

            In ComboBox108 (with sorted alpha -numeric) from ComboBox103 introduce all the lines that are of type Assembly the position of file  \UserName.bil. The next step will be removed ComboBox103 lines that appear once. In ComboBox108 remain only Assembly which are used in at least two different upper assemblies



A) Case Assembly used at least 2 times in a Assemblyhigh

            The figure below shows a situation in which an Assemblyis used several times in a Assemblyhigh:




Figure 11

             In the figure above it is to be noted that ‘Assembly’ (PQRS5320-09836-000) is used 6 times in the case ‘Assembly’( PQRS5320-09836 -02,13-003-003) in the file UserName.bil components but appear only once while in the file UserName.grv appear sequentially 6 times, these things lead to following modification of the file UserName.bil :





Figure 12


            It is possible to calculate the gravimetric result of the18(6*PQRS5320-09837-200 and

12* MS21072L3) as  Part using formulas presented later. The way to solve the problem is not optimal, because when you move a whole would complicate procedures for possible correction of one of the six assemblies.



B)Case Assembly used in the various Assemblhigh

            The figure below shows such a situation from UserName.bil and UserName.grv files:
 



Figure 13


            The assembly PQRS5320-45200-000 is used in upper assemblies PQRS5320-45100-000 and PQRS5320-45100-001. In the UserName.bil assembly PQRS5320-45100-000 contain assembly PQRS5320-45200-000 followed by its components. In the case of assembly PQRS5320-45101-001 has the same assembly PQRS5320-45200-000 but is not followed by the components. In Figure 13, right side in file UserName.grv appear gravimetric data for the assembly PQRS5320-45200-000 for both positions of PQRS5320-45100-000 and PQRS5320-45100-001. Correcting the situation is done by modifying the file UserName.bil according to below figure:

 Figure 14


            After making any changes to the file UserName.bil for the two cases is done following coding:

1) A to Z for ‘Assembly’ used several times in Assemblyupper

     a to z  for Part contained in ’Assembly’ used several times in a Assemblyupper



ordering is the following:



            A, B, C ,..., Z for ‘Assembly’ , i.e. a, b , c, ... , z for Part



2) AA - AZ  for ‘Assembly’ used in the different Assemblyupper

    Aa -   Az  for Part contained in ‘Assembly’ used in the different Assemblyupper



ordering is the following:



            AA ,AB ,AC,…,AZ for ‘Assembly’,i.e.  Aa, Ab ,AC,…,Az for Part

           

             I mentioned that UserName.bil obtained from CATIA V5 file is ordered vertical tree‘. For the utilitarian ‘Checker_Doc_W& is required ordering as horizontal tree‘', which is as follows:.



             The horizontal tree‘ shall be as follows:

1) Main(master) ‘Assembly’  are level considered to be n = 0

2) Add all its components (Part and‘Assembly’) which will have n = n + 1 = 0 +1

3) After each ‘Assembly’ (n = 1) is added components (Part’ and‘Assembly’) will be n +1 = 1 +1=2

return to step 3 to the last component of the file UserName.bil.

            After corrections UserName.bil file stored in Combo_box 103 is shown in the following figure:




Figure 15


3.1.2 OPENING AND MODIFING FILE UserName.grv

Data from the file UserName.grv after processing will be stored in ComboBox104. The file UserN ame.grv as to specified for any Part shall contain the following information:






In which:



i’                                            - number of Instance for a Part





                    - represents the weight(kg) and the center of weight(mm)


(I- represents inertia moments( kg*mm2 ).


             Center of weight and moments of inertia are the main system of reference. For each Partwith a number ‘n of  Instance applies the formula::






for compaction in a single Part:

 


The ‘PosGrv’ means Part in  the file UserName.grv



After changes UserName.grv file for each Instance appearing n times a Part is replaced by the gravimetric data compaction and adding Qty = n and PosGrv-position in 'UserName.grv, then stores in ComboBox104, which is presented below 


Figure 16

 3.2 Creation of file type ‘BilGrv’





Up to this moment or created two types of files:



1) TREE with the extension (* .bil) created in CATIA V5 using CatProduct file using command

Bill Material ... ‘, which has been placed in ComboBox103



2) GRAVIM with the extension (*.grv) created in CATIA V5 using CatProduct file using command

    ‘Measure inertia’ which has been entered into ComboBox104



            Next we create the file type ‘BilGrv’  which is an EXCEL file extension (*.CSV), later used as input file in the file Sablon.xls which has different macro in Visual Basic to create the output file UserName.xls.



            So far we have three types of information for ‘Part’ and ‘Assembly’ listed below:



(A) for ‘Part’ in ComboBox103 with the following information:

Assembly | Type | Part Number | Part Descrption | Qty | Nvl | Code | PosBil




from the File UserName.bil, and:

Part( kg ) | XCG(mm) | YCG(mm) | ZCG(mm) | Ixx | Iyy | Izz | Ixy | Ixz | Iyz | Density | Ins | PosGrv

and ComboBox104 from the file UserName.bil,

(B)  for ‘Assembly’ in ComboBox103 with the structure:

Assemblyhigh | Type | Assembly Number | Assembly Descrption | Qty | Nvl | Component | PosBil




             The file type ‘BilGrv’ will combine in ComboBox105 ,  continuation lines ComboBox103 and ComboBox104 ,  in two types of information:

Assembly|Type|Part Number|Part Descrption|Qty_B|m(kg)|Xcg|Ycg|Zcg|Ixx|Iyy|Izz|Ixy|Ixz|Iyz|Nvl|Code|PosBil|Ins|PosGrv|Key|Density           (S1)
for a Part, and:


Assembly | Type |Assembly Number | Assembly  Descrption  | Qty_B | | | | | | | | | | | | Nvl | Code | | | Key


for ‘Assembly’, where ‘ | separate fields 

Nvl         - subordination level in relationship Assemblyhigh- component (‘Part’, ‘Assembly), mainly

                Assemblyhigh’ are Nvl =0



Code      - coding case:

                        1) Assembly’ used at least 2 times in a ‘Assemblyhigh

                        2) Assembly’ used in the diffrent ‘Assemblyhigh



INS       - number Instance



Key      - number position in the file type ‘BilGrv‘

           

            To define the file ‘BilGrv‘ follow the steps below:


P1   : extract each line of
ComboBox103
P2.1: If it is an
Assembly, copy in ComboBox105
P2.2: if it is a
Part is searched ComboBox104 if there is a line same Part Number’ to Part of

          ComboBox103 in step P1, if yes, the lines forming structure (S1) and copy in ComboBox105;
          P1 returns to step up to the last line of
ComboBox103.


            The ComboBox_105 lines will be extracted sequentially one after one character ‘|’ to replace the ‘,|’ and then write sequentially in the UserName.csv, which is an EXCEL file.




4.0 EXCEL FILE ‘Sablon.exe’



            Excel file ‘Sablon.xls’ contine VISUAL BASIC modules which processes file UserName.csv. Using VISUAL BASIC macros in the file is generated UserName.xls from UserName.csv.



            In this phase utilitarian ‘Checker_Doc_W&B’ can be used for any domain  where a project is modeled in CATIA V5. The user can analyze the following situations:



            - If there is Assemblywithout components (Assembly and/or Part)

            - If there Part which does not belong to any Assembly

            - If for a 'Part used 'n' or aAssembly, are modeled a similar number of  ‘Instance



            The errors occur when introducing ‘Assembly /Part Number’ for Partand/or Assembly



            Gravimetry data are calculated for anyAssembly, regardless of the level of subordination to Assemblyupper, which is level 0.



           For EXCEL file ‘Sablon.xls ‘ was carried out in VBA that Assemblyckerel with the name ‘ Start ‘, which amended file ‘ UserNavme.csv ‘ by creation of an EXCEL file which fanatic legions drunk three WorkSheets’ : ‘ W&B ‘ ,’ ASSY ‘ and ‘ GRAVIM ‘. The file so change ‘ UserName.csv ‘ can be saved as EXCEL file with the name ‘Assemblyin.xls ‘, or other desired user name.



     Further, it shows the two cases of files obtained:

             1) Case CatProduct file correctly in the sense that it does not have errors

             2) Case file CatProduct is incorrect:

                         - ‘Assembly’ without components

                         - ‘Part’ without ‘Assembly’

                         - Tree errors
                         - The difference between quantity and number ‘Instance’ for a  ‘Part’


4.1 FILE UserName.xls


a) WorkSheet ‘ W&B’.

WorkSheet ‘ W&B’ is very wide ,and the number of lines is dependent on the size CatProduct file structure for which it has been applied to the utilitarian ‘Checker_Doc_W&B’ . WorkSheet ‘AssemblyIN ‘Assemblyy be divided into three sequences :


DOCUMENTATION
 Figure 17


GRAVIMETRY :

Figure 18


INFO&ERRORS :



Figure 19


4.2 EXAMPLES FILES UserName.xls



            Next it shows the two situations for UserName.xls files:
            1) The case file CatProduct correct in that no errors
            2) The case file CatProduct is wrong:
                        -
Assembly without components(Assemblyand/or Part’)
                        -
Part without Assembly
                        - Errors tree
                        - Difference between
QUANTITY for 'Part'  and number of  'Instance'



4.2.1 UserName.xls  CORRECT






4.2.1 UserName.xls  INCORRECT








E1.      Part’:PQR5320-10712-200 used only once in Assembly’:PQR5530-12150-000(*.bil), but are modeled a number of  5 Instance

E2.         Part’:PQR5320-09812-201(*.bil) without gravity data



Figure 20


 E3.         Instancemarked in red do not belong to an 'Assembly' 




5.0 CONCLUSIONS

 


The utilitarian ‘ Checker_Doc_W&B’ has been created from actual needs in the framework of a aeronautical utilitarian modeled in CATIA V4 and V5. Validation of utilitarian has beenAssemblyde on files of type ‘ TREE ‘ and ‘GRAVIM’, using CatProduct files with over 4,000 ‘Part’ . The utilitarian has been performed in VISUAL FORTRAN under Windows .



ANNEX. Uses files gravimetry



Figure 21. The graph variations in C. G. and Inertial moments of fuel by quantity
 

Figure 22. Moments of inertia variation according to the order of boarding passengers


           



CAZ 1







SABLON




LEGENDA

Errors

'Part' fara  'Assembly'


Quantity of  'Part' different of number of I 'Instance'
'Part' without gravimetry data