1. 程式人生 > >一些浩辰設置及它的bug?

一些浩辰設置及它的bug?

rtu 測試 就會 put stat ets lte 邊界 ptp

  1. gcad執行快捷鍵有問題?
    嘗試修改Setvar("autocompletemode", "19");原因是’輸入按鍵時顯示建議列表’這個項打鉤了,這裏首先捕捉的是lisp定義的命令,而不是pgp.
  2. 設置了系統變量:Dynmode,0動態輸入,這個參數將導致zoom縮放的時候,鼠標會發生跳動,並有一定幾率停留在邊界.
    一定要多用zoom測試,即使不設置這個參數也是有一點幾率發生鼠標跳動,只是設置了更容易看見這個問題,並且會產生停留.
    技術分享圖片

  3. gcad的net的選擇集參數有誤.
         //定義選擇集選項
    
          PromptSelectionOptions pso = new PromptSelectionOptions
    
          { 
    
           
    // SingleOnly = true, //不需要空格確認,但是浩辰會變成鼠標單框 SelectEverythingInAperture = true, //鼠標單框 };
    技術分享圖片
    #if !HC2019
    using Autodesk.AutoCAD.ApplicationServices;
    using Autodesk.AutoCAD.DatabaseServices;
    using Autodesk.AutoCAD.DatabaseServices.Filters;
    using Autodesk.AutoCAD.EditorInput;
    
    using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.Colors; using Autodesk.AutoCAD.GraphicsInterface; #else using GrxCAD.DatabaseServices; using GrxCAD.EditorInput; using GrxCAD.Geometry; using GrxCAD.ApplicationServices; using GrxCAD.Runtime; using GrxCAD.Colors;
    using GrxCAD.GraphicsInterface; #endif using System.Collections.Generic; using System.Linq; namespace JJBoxGstarCad_2019 { public static class Test { //請先先用gcad測試test1和test2,可以看到兩段代碼的作用是一樣的. //然後再用acad測試test1和test2,可以看到test2中的SingleOnly的作用. // SingleOnly = true的作用應該是"選擇了圖元後不需要空格確認"立馬成為一個選擇集,而不是成為一個鼠標單選框. // SelectEverythingInAperture = true,為鼠標單框. [CommandMethod("test1", CommandFlags.Modal | CommandFlags.UsePickSet)] public static void Test1() { Database db = HostApplicationServices.WorkingDatabase;//當前的數據庫 DocumentCollection doc = Application.DocumentManager; Editor ed = doc.MdiActiveDocument.Editor; //定義選擇集選項 PromptSelectionOptions pso = new PromptSelectionOptions { AllowDuplicates = false, //重復選擇 // SingleOnly = true, //不需要空格確認,但是浩辰會變成單選 SelectEverythingInAperture = true, //鼠標單框 }; var ssPsr = ed.GetSelection(pso); if (ssPsr.Status != PromptStatus.OK) return; using (Transaction tr = db.TransactionManager.StartTransaction()) { foreach (var id in ssPsr.Value.GetObjectIds())//遍歷選擇集亮顯測試用 { var ent = (Entity)id.GetObject(OpenMode.ForRead); ent.Highlight(); } tr.Commit(); } } [CommandMethod("test2", CommandFlags.Modal | CommandFlags.UsePickSet)] public static void Test2() { Database db = HostApplicationServices.WorkingDatabase;//當前的數據庫 DocumentCollection doc = Application.DocumentManager; Editor ed = doc.MdiActiveDocument.Editor; //定義選擇集選項 PromptSelectionOptions pso = new PromptSelectionOptions { AllowDuplicates = false, //重復選擇 SingleOnly = true, //不需要空格確認,但是浩辰會變成單選 // SelectEverythingInAperture = true, //鼠標單框 }; var ssPsr = ed.GetSelection(pso); if (ssPsr.Status != PromptStatus.OK) return; using (Transaction tr = db.TransactionManager.StartTransaction()) { foreach (var id in ssPsr.Value.GetObjectIds())//遍歷選擇集亮顯測試用 { var ent = (Entity)id.GetObject(OpenMode.ForRead); ent.Highlight(); } tr.Commit(); } } } }
    View Code

  4. gcad的net的組塊問題,這裏將導致圖元出現不可選擇的問題..
    技術分享圖片
    #if !HC2019
    using Autodesk.AutoCAD.ApplicationServices;
    using Autodesk.AutoCAD.DatabaseServices;
    using Autodesk.AutoCAD.DatabaseServices.Filters;
    using Autodesk.AutoCAD.EditorInput;
    using Autodesk.AutoCAD.Geometry;
    using Autodesk.AutoCAD.Runtime;
    #else
    using GrxCAD.DatabaseServices;
    using GrxCAD.EditorInput;
    using GrxCAD.Geometry;
    using GrxCAD.ApplicationServices;
    using GrxCAD.Runtime;
    #endif
    using System;
    using static JingJingBoxDD.CadSystem;
    
    
    
    public class Command_jjline
    {
        [CommandMethod("LL", CommandFlags.Modal | CommandFlags.DocExclusiveLock)]
        public static void LL()
        {
            Database db = HostApplicationServices.WorkingDatabase;//當前的數據庫
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
    
            try
            {
                PromptPointOptions ppo1 = new PromptPointOptions("\n指定第一點:");
                PromptPointResult ppr1 = ed.GetPoint(ppo1);//用戶點選             
                if (ppr1.Status != PromptStatus.OK)
                {
                    return;
                }
    
                PromptPointOptions ppo2 = new PromptPointOptions("\n指定另一點:")
                {
                    UseBasePoint = true,
                    BasePoint = ppr1.Value
                };
                PromptPointResult ppr2 = ed.GetPoint(ppo2);//用戶點選             
                if (ppr2.Status != PromptStatus.OK)
                {
                    return;
                }
    
                //生成xline
                using (Transaction tr = db.TransactionManager.StartTransaction())
                {
                    //塊表
                    BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForWrite);
                    Line line = new Line
                    {
                        StartPoint = ppr1.Value,
                        EndPoint = ppr2.Value,
                    };
                    //添加一個新的塊表記錄,這個記錄將存放塊參照的所有圖元
                    BlockTableRecord btrNew = new BlockTableRecord { Name = "test", Origin = line.StartPoint };
                    btrNew.AppendEntity(line);
                    bt.Add(btrNew);
                    tr.AddNewlyCreatedDBObject(btrNew, true);//添加新創建的數據庫對象  
    
    
                    //新建塊參照加入到當前空間
                    BlockReference br = new BlockReference(line.StartPoint, btrNew.ObjectId)
                    {
                        ScaleFactors = new Scale3d()
                    };
    
                    //當前空間的塊表記錄
                    BlockTableRecord btrCu = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                    var brId = btrCu.AppendEntity(br);  //加入塊表記錄
    
                    //※※※※※※※※※※※※※※※※※   tr.AddNewlyCreatedDBObject(br, true);    //這句如果在變形之後,將導致浩辰不可以選擇塊
    
                    //計算變換矩陣 
                    Matrix3d mt = Matrix3d.Rotation(Math.PI, Vector3d.ZAxis, line.StartPoint);
                    Entity ent = (Entity)brId.GetObject(OpenMode.ForWrite);
                    ent.TransformBy(mt);
    
                    tr.AddNewlyCreatedDBObject(br, true);    //這句如果在變形之後,將導致浩辰不可以選擇塊
    
                    btrCu.DowngradeOpen();
                    br.DowngradeOpen();
                    tr.Commit();
                }
            }
            catch (System.Exception e)
            {
                ed.WriteMessage(e.Message);
                throw e;
            }
        }
    }
    View Code

  5. acad允許但是浩辰不允許,新建文字樣式的時候如果用到.TTF字體,直接寫字體名稱就好了,不能夠寫"新宋體.TTF"不然就會出錯,而acad想怎麽寫都可以.否則出現以下情況:
    技術分享圖片技術分享圖片
    看上去是亂碼的一坨東西,而文字樣式面板的字體名多了個(X)...

一些浩辰設置及它的bug?