예제 #1
0
 public void PIK_LispInsertBlockFromFbDwg([CanBeNull] ResultBuffer rb)
 {
     try
     {
         if (rb == null)
         {
             return;
         }
         var tvs = rb.AsArray();
         if (!tvs.Any())
         {
             return;
         }
         var fileName  = tvs[0].Value.ToString();
         var layerName = tvs[1].Value.ToString();
         var layer     = new LayerInfo(layerName);
         var matchs    = tvs.Skip(2).ToList();
         var file      = Path.Combine(PikSettings.LocalSettingsFolder, @"flexBrics\dwg\", fileName);
         VisualInsertBlock.InsertBlock(file,
                                       n => matchs.Any(r => Regex.IsMatch(n, r.Value.ToString(), RegexOptions.IgnoreCase)),
                                       layer);
     }
     catch (Exception ex)
     {
         Logger.Log.Error(ex, "PIK_LispInsertBlockFromFbDwg");
     }
 }
예제 #2
0
        private void OnInsertExecute(IVisualBlock block)
        {
            var doc = AcadHelper.Doc;

            using (doc.LockDocument())
            {
                if (IsHideWindow)
                {
                    HideMe();
                    VisualInsertBlock.Insert(block, Explode);
                }
                else
                {
                    using (HideWindow())
                    {
                        VisualInsertBlock.Insert(block, Explode);
                    }
                }
            }
        }