Beispiel #1
0
 private void model2_WorkCompleted(object sender, devDept.Eyeshot.WorkCompletedEventArgs e)
 {
     if (e.WorkUnit is ReadFileAsync)
     {
         ReadFileAsync rfa = (ReadFileAsync)e.WorkUnit;
         rfa.AddToScene(model1);
         model1.SetView(viewType.Trimetric, true, model1.AnimateCamera);
     }
 }
Beispiel #2
0
 private void model1_WorkCompleted(object sender, devDept.Eyeshot.WorkCompletedEventArgs e)
 {
     if (e.WorkUnit is ReadFileAsync)
     {
         ReadFileAsync ra = (ReadFileAsync)e.WorkUnit;
         ra.AddToScene(model1, new RegenOptions()
         {
             Async = true
         });
     }
 }
Beispiel #3
0
        private void model1_WorkCompleted(object sender, devDept.Eyeshot.WorkCompletedEventArgs e)
        {
            // checks the WorkUnit type, more than one can be present in the same application
            if (e.WorkUnit is ReadFileAsync)
            {
                ReadFileAsync rfa = (ReadFileAsync)e.WorkUnit;

                ReadFile rf = e.WorkUnit as ReadFile;
                if (rf != null)
                {
                    _skipZoomFit = rf.FileSerializer.FileBody.Camera != null;
                }
                else
                {
                    _skipZoomFit = false;
                }

                if (rfa.Entities != null && _yAxisUp)
                {
                    rfa.RotateEverythingAroundX();
                }

                rfa.AddToScene(model1);

                model1.Layers[0].LineWeight = 2;
                model1.Layers[0].Color      = MyModel.DrawingColor;
                model1.Layers.TryAdd(new Layer("Dimensions", System.Drawing.Color.ForestGreen));
                model1.Layers.TryAdd(new Layer("Reference geometry", System.Drawing.Color.Red));
                tableTabControl.Sync();


                if (System.IO.Path.GetFileName(rfa.FileName) == "app8.dwg")
                {
                    foreach (Entity ent in model1.Entities)
                    {
                        ent.Translate(-170, -400);
                    }

                    model1.Entities.Regen();
                    model1.Camera.Target     = new Point3D(75, 3.5, 288);
                    model1.Camera.ZoomFactor = 3;
                    _skipZoomFit             = true;
                }


                if (!_skipZoomFit)
                {
                    model1.SetView(viewType.Top, true, false);
                }
            }

            EnableControls(true);
        }
Beispiel #4
0
        private void model1_WorkCompleted(object sender, devDept.Eyeshot.WorkCompletedEventArgs e)
        {
            if (e.WorkUnit is ReadFileAsync)
            {
                assemblyTreeView1.ClearCurrent(true);

                ReadFileAsync ra = (ReadFileAsync)e.WorkUnit;

                if (_yAxisUp)
                {
                    ra.RotateEverythingAroundX();
                }

                // updates model units and its related combo box
                if (e.WorkUnit is ReadFileAsyncWithBlocks)
                {
                    model1.Units = ((ReadFileAsyncWithBlocks)e.WorkUnit).Units;
                }

                ra.AddToScene(model1, new RegenOptions()
                {
                    Async = true
                });
            }
            else if (e.WorkUnit is Regeneration)
            {
                assemblyTreeView1.PopulateTree(model1.Entities);

                model1.Entities.UpdateBoundingBox();
                UpdateFastZprButton();
                model1.ZoomFit();
                model1.Invalidate();
            }

            openButton.IsEnabled   = true;
            saveButton.IsEnabled   = true;
            importButton.IsEnabled = true;
            exportButton.IsEnabled = true;
        }