using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
namespace BeamSectionPlugin
{
public class BeamSectionDrawer
{
private static BeamSettings settings = new BeamSettings();
private static readonly HashSet<string> loadedDatabases = new HashSet<string>();
private static Point3d? lastBeamEnd = null;
private static double? lastSlabZ = null;
private static Point3d? lastSlabEnd = null;
[CommandMethod("DB")]
public void DrawBeamSection()
{
Document doc = AcadApp.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
Database db = doc.Database;
// 加载设置窗体
DialogResult dialogResult;
using (var form = new SettingsForm(settings))
{
dialogResult = AcadApp.ShowModalDialog(form);
}
if (dialogResult != DialogResult.OK) return;
// 保存原始系统变量设置
int oldOrthoMode = Convert.ToInt32(AcadApp.GetSystemVariable("ORTHOMODE"));
int oldPolarMode = Convert.ToInt32(AcadApp.GetSystemVariable("POLARMODE"));
int oldAutoSnap = Convert.ToInt32(AcadApp.GetSystemVariable("AUTOSNAP"));
int oldOsMode = Convert.ToInt32(AcadApp.GetSystemVariable("OSMODE"));
int oldTrackPath = Convert.ToInt32(AcadApp.GetSystemVariable("TRACKPATH"));
try
{
// 启用正交模式、极轴追踪和对象捕捉
SetOsnapSettings();
// 重置连续绘制状态
lastBeamEnd = null;
lastSlabZ = null;
lastSlabEnd = null;
while (true)
{
try
{
Point3d firstPoint;
Point3d? prevSlabEndForConnection = null;
// 步骤1: 获取梁的第一点
if (lastBeamEnd.HasValue)
{
string continuePrompt = "\n请点击梁的第一点 (或按回车从上一端点继续): ";
PromptPointOptions firstPointOpts = new PromptPointOptions(continuePrompt);
firstPointOpts.AllowNone = true;
PromptPointResult firstPointRes = ed.GetPoint(firstPointOpts);
if (firstPointRes.Status == PromptStatus.None)
{
firstPoint = lastBeamEnd.Value;
if (lastSlabEnd.HasValue)
{
prevSlabEndForConnection = lastSlabEnd.Value;
}
}
else if (firstPointRes.Status == PromptStatus.OK)
{
firstPoint = firstPointRes.Value;
}
else
{
return;
}
}
else
{
PromptPointOptions firstPointOpts = new PromptPointOptions("\n请点击梁的第一点: ");
PromptPointResult firstPointRes = ed.GetPoint(firstPointOpts);
if (firstPointRes.Status != PromptStatus.OK) return;
firstPoint = firstPointRes.Value;
}
// 绘制板底连接线
if (prevSlabEndForConnection.HasValue && lastSlabZ.HasValue)
{
Point3d newSlabStart = new Point3d(
firstPoint.X,
firstPoint.Y,
lastSlabZ.Value
);
DrawSlabConnectionLine(db, prevSlabEndForConnection.Value, newSlabStart);
ed.Regen();
}
// 确保捕捉设置有效
SetOsnapSettings();
ed.UpdateScreen();
// 步骤2: 获取梁的第二点
Point3d secondPoint;
PromptPointResult secondPointRes;
if (!lastBeamEnd.HasValue)
{
PromptPointOptions secondPointOpts = new PromptPointOptions("\n请点击梁的第二点: ");
secondPointOpts.UseBasePoint = true;
secondPointOpts.BasePoint = firstPoint;
secondPointOpts.UseDashedLine = true;
SetOsnapSettings();
ed.UpdateScreen();
secondPointRes = ed.GetPoint(secondPointOpts);
if (secondPointRes.Status != PromptStatus.OK) return;
secondPoint = secondPointRes.Value;
}
else
{
PromptPointOptions secondPointOpts = new PromptPointOptions("\n请点击梁的第二点[板厚(A)升降板(S)]: ");
secondPointOpts.Keywords.Add("A");
secondPointOpts.Keywords.Add("S");
secondPointOpts.AllowNone = true;
secondPointOpts.UseBasePoint = true;
secondPointOpts.BasePoint = firstPoint;
secondPointOpts.UseDashedLine = true;
secondPointOpts.AppendKeywordsToMessage = true;
secondPointRes = ed.GetPoint(secondPointOpts);
while (secondPointRes.Status == PromptStatus.Keyword)
{
if (secondPointRes.StringResult == "A")
{
PromptDoubleOptions pdo = new PromptDoubleOptions("\n输入板厚(mm)<" + settings.SlabThickness.ToString() + ">: ");
pdo.DefaultValue = settings.SlabThickness;
pdo.UseDefaultValue = true;
PromptDoubleResult slabThicknessRes = ed.GetDouble(pdo);
if (slabThicknessRes.Status != PromptStatus.OK) return;
settings.SlabThickness = slabThicknessRes.Value;
}
else if (secondPointRes.StringResult == "S")
{
PromptDoubleOptions pdo = new PromptDoubleOptions("\n请输入升降板高度(升板为正数,降板为负数)mm<" + settings.SlabHeightOffset.ToString() + ">: ");
pdo.DefaultValue = settings.SlabHeightOffset;
pdo.UseDefaultValue = true;
PromptDoubleResult slabHeightRes = ed.GetDouble(pdo);
if (slabHeightRes.Status != PromptStatus.OK) return;
settings.SlabHeightOffset = slabHeightRes.Value;
}
SetOsnapSettings();
ed.UpdateScreen();
secondPointRes = ed.GetPoint(secondPointOpts);
}
if (secondPointRes.Status != PromptStatus.OK) return;
secondPoint = secondPointRes.Value;
}
// 确保两点不在同一位置
if (firstPoint.DistanceTo(secondPoint) < 0.001)
{
ed.WriteMessage("\n错误: 两点位置相同,请重新选择");
continue;
}
// 步骤3: 获取梁高
PromptDoubleOptions heightOpts = new PromptDoubleOptions("\n请输入梁高(mm)<" + settings.BeamHeight.ToString() + ">: ");
heightOpts.DefaultValue = settings.BeamHeight;
heightOpts.UseDefaultValue = true;
heightOpts.AllowNegative = false;
heightOpts.AllowZero = false;
PromptDoubleResult beamHeightRes = ed.GetDouble(heightOpts);
if (beamHeightRes.Status != PromptStatus.OK) return;
double beamHeight = beamHeightRes.Value;
settings.BeamHeight = beamHeight;
// 预加载所需块
LoadSupportBlocks(db, new[] {
"ScaffoldPole梁侧模",
"ScaffoldPole断面木方",
"ScaffoldPole断面方钢",
"ScaffoldPole横向龙骨"
}, ed);
// 步骤4: 绘制梁侧模
if (settings.DrawBeamFormwork)
DrawBeamFormwork(db, firstPoint, secondPoint, beamHeight, ed);
// 步骤5: 绘制板底线
Point3d slabEndPoint = DrawSlabLine(db, firstPoint, secondPoint, beamHeight);
// 保存板底线终点用于连续绘制
lastSlabEnd = slabEndPoint;
// 步骤6: 绘制板下龙骨
if (settings.DrawSlabSupport)
{
DrawSlabSupport(db, firstPoint, secondPoint, beamHeight);
}
// 更新连续绘制状态
lastBeamEnd = secondPoint;
lastSlabZ = firstPoint.Z + beamHeight + settings.SlabThickness + settings.SlabHeightOffset;
}
catch (System.Exception ex)
{
ed.WriteMessage($"\n错误: {ex.Message}\n{ex.StackTrace}");
string dbKey = db.Filename ?? db.GetHashCode().ToString();
loadedDatabases.Remove(dbKey);
}
}
}
finally
{
// 恢复原始系统变量设置
AcadApp.SetSystemVariable("ORTHOMODE", oldOrthoMode);
AcadApp.SetSystemVariable("POLARMODE", oldPolarMode);
AcadApp.SetSystemVariable("AUTOSNAP", oldAutoSnap);
AcadApp.SetSystemVariable("OSMODE", oldOsMode);
AcadApp.SetSystemVariable("TRACKPATH", oldTrackPath);
}
}
// 绘制板底连接线
private void DrawSlabConnectionLine(Database db, Point3d startPoint, Point3d endPoint)
{
if (startPoint.DistanceTo(endPoint) < 0.001) return;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
Line connectionLine = new Line(startPoint, endPoint);
connectionLine.ColorIndex = 1;
connectionLine.LineWeight = LineWeight.LineWeight030;
btr.AppendEntity(connectionLine);
tr.AddNewlyCreatedDBObject(connectionLine, true);
tr.Commit();
}
}
// 绘制板底线并返回终点
private Point3d DrawSlabLine(Database db, Point3d beamStart, Point3d beamEnd, double beamHeight)
{
// 计算板底高度
double slabZ = beamStart.Z + beamHeight + settings.SlabThickness + settings.SlabHeightOffset;
Point3d slabEndPoint = new Point3d(beamEnd.X, beamEnd.Y, slabZ);
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
Line slabLine = new Line(
new Point3d(beamStart.X, beamStart.Y, slabZ),
slabEndPoint
);
slabLine.ColorIndex = 2;
slabLine.LineWeight = LineWeight.LineWeight030;
btr.AppendEntity(slabLine);
tr.AddNewlyCreatedDBObject(slabLine, true);
tr.Commit();
}
return slabEndPoint;
}
private void SetOsnapSettings()
{
try
{
AcadApp.SetSystemVariable("ORTHOMODE", 1);
AcadApp.SetSystemVariable("POLARMODE", 1);
AcadApp.SetSystemVariable("AUTOSNAP", 63);
AcadApp.SetSystemVariable("TRACKPATH", 1);
AcadApp.SetSystemVariable("TRACERAYS", 1);
int osMode = 0;
osMode |= 1; // 端点
osMode |= 2; // 中点
osMode |= 4; // 圆心
osMode |= 8; // 节点
osMode |= 16; // 象限点
osMode |= 32; // 交点
osMode |= 64; // 插入点
osMode |= 128; // 垂足
osMode |= 512; // 最近点
osMode |= 2048; // 外观交点
osMode |= 4096; // 延长线
AcadApp.SetSystemVariable("OSMODE", osMode);
}
catch { }
}
private void LoadSupportBlocks(Database db, IEnumerable<string> requiredBlocks, Editor ed)
{
string dbKey = db.Filename ?? db.GetHashCode().ToString();
if (loadedDatabases.Contains(dbKey))
return;
// 1. 尝试加载合并的块文件
string blockFilePath = FindBlockFile();
if (!string.IsNullOrEmpty(blockFilePath))
{
using (Database sourceDb = new Database(false, true))
{
try
{
sourceDb.ReadDwgFile(blockFilePath, FileOpenMode.OpenForReadAndAllShare, false, null);
}
catch (Exception ex)
{
ed.WriteMessage($"\n错误: 无法读取块文件 '{blockFilePath}': {ex.Message}");
return;
}
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
foreach (string blockName in requiredBlocks)
{
if (!bt.Has(blockName))
{
try
{
db.Insert(blockName, sourceDb, true);
ed.WriteMessage($"\n已加载块: {blockName}");
}
catch (Exception ex)
{
ed.WriteMessage($"\n错误: 无法插入块 '{blockName}': {ex.Message}");
}
}
}
tr.Commit();
}
}
loadedDatabases.Add(dbKey);
return;
}
// 2. 加载单个块文件
string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string blockDir = Path.Combine(currentDir, "ScaffoldBlocks");
if (!Directory.Exists(blockDir))
{
blockDir = Path.Combine(Directory.GetParent(currentDir).FullName, "ScaffoldBlocks");
if (!Directory.Exists(blockDir))
{
loadedDatabases.Add(dbKey);
ed.WriteMessage("\n错误: ScaffoldBlocks目录未找到,请确认ScaffoldBlocks目录存在");
return;
}
}
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
foreach (string blockName in requiredBlocks)
{
if (bt.Has(blockName)) continue;
string blockFile = Path.Combine(blockDir, blockName + ".dwg");
if (!File.Exists(blockFile))
{
ed.WriteMessage($"\n错误: 找不到图块文件: {blockFile}");
continue;
}
using (Database sourceDb = new Database(false, true))
{
try
{
sourceDb.ReadDwgFile(blockFile, FileOpenMode.OpenForReadAndAllShare, false, null);
db.Insert(blockName, sourceDb, true);
ed.WriteMessage($"\n已加载块: {blockName}");
}
catch (Exception ex)
{
ed.WriteMessage($"\n错误: 无法加载块 '{blockName}': {ex.Message}");
}
}
}
tr.Commit();
}
loadedDatabases.Add(dbKey);
}
private string FindBlockFile()
{
string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
// 1. 检查ScaffoldBlocks子目录
string blockFile = Path.Combine(currentDir, "ScaffoldBlocks", "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
// 2. 检查当前目录
blockFile = Path.Combine(currentDir, "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
// 3. 安全获取AutoCAD支持路径
string acadPaths = "";
try
{
if (AcadApp.MainWindow != null)
{
object supportVar = AcadApp.GetSystemVariable("SUPPORT");
if (supportVar != null) acadPaths = supportVar.ToString();
}
}
catch
{
acadPaths = "";
}
// 4. 检查所有支持路径
if (!string.IsNullOrEmpty(acadPaths))
{
char[] separators = new char[] { ';', ',' };
foreach (string path in acadPaths.Split(separators, StringSplitOptions.RemoveEmptyEntries))
{
try
{
// 检查路径根目录
blockFile = Path.Combine(path.Trim(), "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
// 检查路径下的ScaffoldBlocks子目录
blockFile = Path.Combine(path.Trim(), "ScaffoldBlocks", "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
}
catch { }
}
}
// 5. 检查标准插件目录
string[] pluginPaths = new string[]
{
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Autodesk", "ApplicationPlugins", "BeamSectionPlugin.bundle"),
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
"Autodesk", "ApplicationPlugins", "BeamSectionPlugin.bundle")
};
foreach (string pluginDir in pluginPaths)
{
try
{
// 检查插件目录
blockFile = Path.Combine(pluginDir, "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
// 检查插件目录下的ScaffoldBlocks子目录
blockFile = Path.Combine(pluginDir, "ScaffoldBlocks", "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
}
catch { }
}
// 6. 最终检查程序集所在目录的子目录
try
{
blockFile = Path.Combine(currentDir, "Resources", "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
blockFile = Path.Combine(currentDir, "Resources", "ScaffoldBlocks", "ScaffoldBlocks.dwg");
if (File.Exists(blockFile)) return blockFile;
}
catch { }
return null;
}
private void DrawBeamFormwork(Database db, Point3d start, Point3d end, double beamHeight, Editor ed)
{
double length = start.DistanceTo(end);
double halfLength = length / 2;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
const string beamBlockName = "ScaffoldPole梁侧模";
if (!bt.Has(beamBlockName))
{
ed.WriteMessage($"\n错误: 找不到图块 '{beamBlockName}',请确认ScaffoldBlocks目录存在");
tr.Commit();
return;
}
// 计算中点作为插入点
Point3d midPoint = new Point3d(
(start.X + end.X) / 2,
(start.Y + end.Y) / 2,
start.Z
);
// 创建块引用
BlockReference beamRef = new BlockReference(midPoint, bt[beamBlockName]);
btr.AppendEntity(beamRef);
tr.AddNewlyCreatedDBObject(beamRef, true);
// 强制重生成图形
ed.Regen();
try
{
// 重新获取块引用确保状态更新
beamRef = (BlockReference)tr.GetObject(beamRef.ObjectId, OpenMode.ForWrite);
// 计算方向并旋转
Vector3d direction = end - start;
double angle = direction.GetAngleTo(Vector3d.XAxis);
beamRef.TransformBy(Matrix3d.Rotation(angle, Vector3d.ZAxis, midPoint));
// 计算调整后的梁高(减去板厚)
double adjustedBeamHeight = beamHeight - settings.SlabThickness;
if (adjustedBeamHeight < 50) adjustedBeamHeight = 50;
// 计算梁宽的一半
double halfBeamWidth = settings.BeamWidth / 2;
// 检查是否为动态块
if (!beamRef.IsDynamicBlock)
{
ed.WriteMessage("\n警告:插入的图块不是动态块,无法设置参数,将使用几何绘制替代");
DrawBeamGeometry(db, start, end, beamHeight, ed);
tr.Commit();
return;
}
// 验证动态块表记录是否有效
ObjectId dynBlockId = beamRef.DynamicBlockTableRecord;
if (!dynBlockId.IsValid)
{
ed.WriteMessage("\n警告:动态块表记录无效");
tr.Commit();
return;
}
BlockTableRecord dynBtr = (BlockTableRecord)tr.GetObject(dynBlockId, OpenMode.ForRead);
ed.WriteMessage($"\n动态块名称: {dynBtr.Name}");
// 获取动态属性
DynamicBlockReferencePropertyCollection props = beamRef.DynamicBlockReferencePropertyCollection;
ed.WriteMessage($"\n找到动态属性: {props.Count}个");
// 输出所有属性名用于调试
foreach (DynamicBlockReferenceProperty prop in props)
{
ed.WriteMessage($"\n- {prop.PropertyName} (类型: {prop.UnitsType})");
}
// 设置属性 - 使用精确匹配
bool leftDistanceSet = false;
bool rightDistanceSet = false;
bool beamHeightSet = false;
bool beamWidthSet = false;
foreach (DynamicBlockReferenceProperty prop in props)
{
string propName = prop.PropertyName;
try
{
// 左距离属性
if (propName.Equals("左距离", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("LeftDistance", StringComparison.OrdinalIgnoreCase))
{
prop.Value = halfBeamWidth;
leftDistanceSet = true;
ed.WriteMessage($"\n设置左距离: {halfBeamWidth}mm");
}
// 右距离属性
else if (propName.Equals("右距离", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("RightDistance", StringComparison.OrdinalIgnoreCase))
{
prop.Value = halfBeamWidth;
rightDistanceSet = true;
ed.WriteMessage($"\n设置右距离: {halfBeamWidth}mm");
}
// 梁高属性
else if (propName.Equals("梁高", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("BeamHeight", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("梁高度", StringComparison.OrdinalIgnoreCase))
{
prop.Value = adjustedBeamHeight;
beamHeightSet = true;
ed.WriteMessage($"\n设置梁高: {adjustedBeamHeight}mm");
}
// L梁高属性
else if (propName.Equals("L梁高", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("L_BeamHeight", StringComparison.OrdinalIgnoreCase))
{
prop.Value = adjustedBeamHeight;
beamHeightSet = true;
ed.WriteMessage($"\n设置L梁高: {adjustedBeamHeight}mm");
}
// M梁高属性
else if (propName.Equals("M梁高", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("M_BeamHeight", StringComparison.OrdinalIgnoreCase))
{
prop.Value = adjustedBeamHeight;
beamHeightSet = true;
ed.WriteMessage($"\n设置M梁高: {adjustedBeamHeight}mm");
}
// 梁宽属性
else if (propName.Equals("梁宽", StringComparison.OrdinalIgnoreCase) ||
propName.Equals("BeamWidth", StringComparison.OrdinalIgnoreCase))
{
prop.Value = settings.BeamWidth;
beamWidthSet = true;
ed.WriteMessage($"\n设置梁宽: {settings.BeamWidth}mm");
}
// 延伸宽度属性
else if (propName.Contains("延伸") || propName.Contains("Extension"))
{
prop.Value = settings.BeamExtension;
ed.WriteMessage($"\n设置延伸宽度: {settings.BeamExtension}mm");
}
}
catch (System.Exception propEx)
{
ed.WriteMessage($"\n设置属性 {prop.PropertyName} 时出错: {propEx.Message}");
}
}
// 检查关键参数是否设置成功
if (!leftDistanceSet) ed.WriteMessage("\n警告: 未找到左距离参数");
if (!rightDistanceSet) ed.WriteMessage("\n警告: 未找到右距离参数");
if (!beamHeightSet) ed.WriteMessage("\n警告: 未找到梁高参数");
if (!beamWidthSet) ed.WriteMessage("\n警告: 未找到梁宽参数");
// 正确刷新动态块
beamRef.ResetBlock();
ed.Regen();
}
catch (System.Exception ex)
{
ed.WriteMessage($"\n操作动态块时出错: {ex.Message}");
}
tr.Commit();
}
}
// 几何绘制替代方案
private void DrawBeamGeometry(Database db, Point3d start, Point3d end, double beamHeight, Editor ed)
{
double adjustedBeamHeight = beamHeight - settings.SlabThickness;
if (adjustedBeamHeight < 50) adjustedBeamHeight = 50;
double halfBeamWidth = settings.BeamWidth / 2;
Vector3d direction = (end - start).GetNormal();
Vector3d perpendicular = direction.GetPerpendicularVector().GetNormal();
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
// 计算四个角点
Point3d bottomLeft = start + (perpendicular * halfBeamWidth);
Point3d bottomRight = start - (perpendicular * halfBeamWidth);
Point3d topLeft = bottomLeft + new Vector3d(0, 0, adjustedBeamHeight);
Point3d topRight = bottomRight + new Vector3d(0, 0, adjustedBeamHeight);
// 绘制梁侧模几何
Line leftSide = new Line(bottomLeft, topLeft);
leftSide.ColorIndex = 3;
btr.AppendEntity(leftSide);
tr.AddNewlyCreatedDBObject(leftSide, true);
Line rightSide = new Line(bottomRight, topRight);
rightSide.ColorIndex = 3;
btr.AppendEntity(rightSide);
tr.AddNewlyCreatedDBObject(rightSide, true);
Line bottomLine = new Line(bottomLeft, bottomRight);
bottomLine.ColorIndex = 3;
btr.AppendEntity(bottomLine);
tr.AddNewlyCreatedDBObject(bottomLine, true);
Line topLine = new Line(topLeft, topRight);
topLine.ColorIndex = 3;
btr.AppendEntity(topLine);
tr.AddNewlyCreatedDBObject(topLine, true);
tr.Commit();
}
}
private void DrawSlabSupport(Database db, Point3d beamStart, Point3d beamEnd, double beamHeight)
{
if (!settings.DrawSlabSupport) return;
Vector3d beamDirection = (beamEnd - beamStart).GetNormal();
double beamLength = beamStart.DistanceTo(beamEnd);
// 计算板底位置
double slabZOffset = beamHeight + settings.SlabThickness + settings.SlabHeightOffset;
Point3d slabStart = new Point3d(beamStart.X, beamStart.Y, beamStart.Z + slabZOffset);
Point3d slabEnd = new Point3d(beamEnd.X, beamEnd.Y, beamEnd.Z + slabZOffset);
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
if (settings.SlabMainDirection == "横向")
{
string blockName = settings.SlabSecondaryMaterial.Contains("方钢") ?
"ScaffoldPole断面方钢" : "ScaffoldPole断面木方";
if (!bt.Has(blockName))
{
tr.Commit();
return;
}
int arrayCount = Math.Max(2, (int)Math.Ceiling(beamLength / settings.SlabSecondarySpacing));
double spacing = beamLength / (arrayCount - 1);
for (int i = 0; i < arrayCount; i++)
{
Point3d position = slabStart + (beamDirection * (i * spacing));
BlockReference supportRef = new BlockReference(position, bt[blockName]);
btr.AppendEntity(supportRef);
tr.AddNewlyCreatedDBObject(supportRef, true);
// 设置材料尺寸
foreach (DynamicBlockReferenceProperty prop in supportRef.DynamicBlockReferencePropertyCollection)
{
string propName = prop.PropertyName.ToLower();
if (propName.Contains("宽度"))
{
prop.Value = settings.SlabSecondaryWidth;
}
else if (propName.Contains("高度"))
{
prop.Value = settings.SlabSecondaryHeight;
}
}
double angle = 0;
if (settings.SlabMainDirection != "横向")
{
angle = Math.PI / 2;
}
supportRef.TransformBy(Matrix3d.Rotation(angle, Vector3d.ZAxis, position));
}
}
else
{
const string slabBlockName = "ScaffoldPole横向龙骨";
if (!bt.Has(slabBlockName))
{
tr.Commit();
return;
}
Point3d center = new Point3d(
(slabStart.X + slabEnd.X) / 2,
(slabStart.Y + slabEnd.Y) / 2,
slabStart.Z
);
BlockReference supportRef = new BlockReference(center, bt[slabBlockName]);
btr.AppendEntity(supportRef);
tr.AddNewlyCreatedDBObject(supportRef, true);
// 设置属性
foreach (DynamicBlockReferenceProperty prop in supportRef.DynamicBlockReferencePropertyCollection)
{
string propName = prop.PropertyName.ToLower();
if (propName.Contains("长度"))
{
prop.Value = beamLength;
}
else if (propName.Contains("次龙骨宽"))
{
prop.Value = settings.SlabSecondaryWidth;
}
else if (propName.Contains("次龙骨高"))
{
prop.Value = settings.SlabSecondaryHeight;
}
}
// 旋转方向
Vector3d dir = beamEnd - beamStart;
double angle = dir.GetAngleTo(Vector3d.XAxis);
supportRef.TransformBy(Matrix3d.Rotation(angle, Vector3d.ZAxis, center));
}
tr.Commit();
}
}
}
public class BeamSettings
{
public bool DrawBeamFormwork { get; set; } = true;
public bool DrawBeamSupport { get; set; } = true;
public string BeamMainDirection { get; set; } = "横向";
public double BeamExtension { get; set; } = 50;
public double BeamWidth { get; set; } = 200;
public double BeamHeight { get; set; } = 1000;
public string BeamMainMaterial { get; set; } = "100方钢";
public string BeamSecondaryMaterial { get; set; } = "50木方";
public double BeamSecondarySpacing { get; set; } = 100;
public double BeamSecondaryHeight { get; set; } = 90;
public double BeamSecondaryWidth { get; set; } = 40;
public double SlabThickness { get; set; } = 120;
public bool DrawSlabSupport { get; set; } = true;
public string SlabMainDirection { get; set; } = "横向";
public bool KeepSupport { get; set; } = true;
public string SlabMainMaterial { get; set; } = "100方钢";
public string SlabSecondaryMaterial { get; set; } = "3木方";
public double SlabSecondarySpacing { get; set; } = 200;
public double SlabSecondaryHeight { get; set; } = 90;
public double SlabSecondaryWidth { get; set; } = 40;
public double SlabHeightOffset { get; set; } = 0;
}
public class SettingsForm : Form
{
private BeamSettings settings;
private Dictionary<string, Control> controls = new Dictionary<string, Control>();
public SettingsForm(BeamSettings settings)
{
this.settings = settings;
InitializeForm();
this.FormClosing += SettingsForm_FormClosing;
}
private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (this.DialogResult == DialogResult.OK)
{
SaveFormData();
}
}
private void SaveFormData()
{
settings.DrawBeamFormwork = ((RadioButton)controls["rbBeamFormworkYes"]).Checked;
settings.DrawBeamSupport = ((RadioButton)controls["rbBeamSupportYes"]).Checked;
settings.BeamMainDirection = ((RadioButton)controls["rbBeamHorizontal"]).Checked ? "横向" : "纵向";
settings.BeamExtension = double.Parse(((TextBox)controls["tbBeamExtension"]).Text);
settings.BeamMainMaterial = ((ComboBox)controls["cbBeamMainMaterial"]).Text;
settings.BeamSecondaryMaterial = ((ComboBox)controls["cbBeamSecondaryMaterial"]).Text;
settings.BeamSecondarySpacing = double.Parse(((TextBox)controls["tbBeamSecondarySpacing"]).Text);
settings.BeamSecondaryHeight = double.Parse(((TextBox)controls["tbBeamSecondaryHeight"]).Text);
settings.BeamSecondaryWidth = double.Parse(((TextBox)controls["tbBeamSecondaryWidth"]).Text);
settings.SlabThickness = double.Parse(((TextBox)controls["tbSlabThickness"]).Text);
settings.DrawSlabSupport = ((RadioButton)controls["rbSlabSupportYes"]).Checked;
settings.SlabMainDirection = ((RadioButton)controls["rbSlabHorizontal"]).Checked ? "横向" : "纵向";
settings.SlabMainMaterial = ((ComboBox)controls["cbSlabMainMaterial"]).Text;
settings.SlabSecondaryMaterial = ((ComboBox)controls["cbSlabSecondaryMaterial"]).Text;
settings.SlabSecondarySpacing = double.Parse(((TextBox)controls["tbSlabSpacing"]).Text);
settings.SlabSecondaryHeight = double.Parse(((TextBox)controls["tbSlabSecondaryHeight"]).Text);
settings.SlabSecondaryWidth = double.Parse(((TextBox)controls["tbSlabSecondaryWidth"]).Text);
}
private void InitializeForm()
{
this.Text = "梁板剖面绘制参数设置";
this.Size = new System.Drawing.Size(450, 650);
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.StartPosition = FormStartPosition.CenterScreen;
TabControl tabControl = new TabControl();
tabControl.Dock = DockStyle.Fill;
TabPage beamTab = new TabPage("梁下龙骨");
InitializeBeamTab(beamTab);
TabPage slabTab = new TabPage("板下龙骨");
InitializeSlabTab(slabTab);
tabControl.TabPages.Add(beamTab);
tabControl.TabPages.Add(slabTab);
Panel buttonPanel = new Panel();
buttonPanel.Dock = DockStyle.Bottom;
buttonPanel.Height = 50;
Button okButton = new Button();
okButton.Text = "开始绘制";
okButton.DialogResult = DialogResult.OK;
okButton.Location = new System.Drawing.Point(120, 10);
okButton.Size = new System.Drawing.Size(90, 30);
Button cancelButton = new Button();
cancelButton.Text = "取消";
cancelButton.DialogResult = DialogResult.Cancel;
cancelButton.Location = new System.Drawing.Point(240, 10);
cancelButton.Size = new System.Drawing.Size(90, 30);
buttonPanel.Controls.Add(okButton);
buttonPanel.Controls.Add(cancelButton);
this.Controls.Add(tabControl);
this.Controls.Add(buttonPanel);
}
private void InitializeBeamTab(TabPage tab)
{
tab.Controls.Clear();
tab.AutoScroll = true;
int yPos = 20;
// 绘制梁侧模
GroupBox gbBeamFormwork = new GroupBox();
gbBeamFormwork.Text = "绘制梁侧模";
gbBeamFormwork.Location = new System.Drawing.Point(20, yPos);
gbBeamFormwork.Size = new System.Drawing.Size(380, 50);
RadioButton rbBeamFormworkYes = new RadioButton();
rbBeamFormworkYes.Text = "是";
rbBeamFormworkYes.Checked = settings.DrawBeamFormwork;
rbBeamFormworkYes.Location = new System.Drawing.Point(30, 20);
controls.Add("rbBeamFormworkYes", rbBeamFormworkYes);
RadioButton rbBeamFormworkNo = new RadioButton();
rbBeamFormworkNo.Text = "否";
rbBeamFormworkNo.Checked = !settings.DrawBeamFormwork;
rbBeamFormworkNo.Location = new System.Drawing.Point(200, 20);
controls.Add("rbBeamFormworkNo", rbBeamFormworkNo);
gbBeamFormwork.Controls.Add(rbBeamFormworkYes);
gbBeamFormwork.Controls.Add(rbBeamFormworkNo);
tab.Controls.Add(gbBeamFormwork);
yPos += 60;
// 绘制梁龙骨
GroupBox gbBeamSupport = new GroupBox();
gbBeamSupport.Text = "绘制梁龙骨";
gbBeamSupport.Location = new System.Drawing.Point(20, yPos);
gbBeamSupport.Size = new System.Drawing.Size(380, 50);
RadioButton rbBeamSupportYes = new RadioButton();
rbBeamSupportYes.Text = "是";
rbBeamSupportYes.Checked = settings.DrawBeamSupport;
rbBeamSupportYes.Location = new System.Drawing.Point(30, 20);
controls.Add("rbBeamSupportYes", rbBeamSupportYes);
RadioButton rbBeamSupportNo = new RadioButton();
rbBeamSupportNo.Text = "否";
rbBeamSupportNo.Checked = !settings.DrawBeamSupport;
rbBeamSupportNo.Location = new System.Drawing.Point(200, 20);
controls.Add("rbBeamSupportNo", rbBeamSupportNo);
gbBeamSupport.Controls.Add(rbBeamSupportYes);
gbBeamSupport.Controls.Add(rbBeamSupportNo);
tab.Controls.Add(gbBeamSupport);
yPos += 60;
// 主龙骨方向
GroupBox gbBeamDirection = new GroupBox();
gbBeamDirection.Text = "主龙骨方向";
gbBeamDirection.Location = new System.Drawing.Point(20, yPos);
gbBeamDirection.Size = new System.Drawing.Size(380, 100);
RadioButton rbBeamHorizontal = new RadioButton();
rbBeamHorizontal.Text = "横向";
rbBeamHorizontal.Checked = (settings.BeamMainDirection == "横向");
rbBeamHorizontal.Location = new System.Drawing.Point(30, 20);
controls.Add("rbBeamHorizontal", rbBeamHorizontal);
RadioButton rbBeamVertical = new RadioButton();
rbBeamVertical.Text = "纵向";
rbBeamVertical.Checked = (settings.BeamMainDirection == "纵向");
rbBeamVertical.Location = new System.Drawing.Point(200, 20);
controls.Add("rbBeamVertical", rbBeamVertical);
Label lblBeamExtension = new Label();
lblBeamExtension.Text = "横龙骨延伸宽度(mm):";
lblBeamExtension.Location = new System.Drawing.Point(30, 60);
lblBeamExtension.AutoSize = true;
TextBox tbBeamExtension = new TextBox();
tbBeamExtension.Text = settings.BeamExtension.ToString();
tbBeamExtension.Location = new System.Drawing.Point(200, 55);
tbBeamExtension.Width = 100;
controls.Add("tbBeamExtension", tbBeamExtension);
gbBeamDirection.Controls.Add(rbBeamHorizontal);
gbBeamDirection.Controls.Add(rbBeamVertical);
gbBeamDirection.Controls.Add(lblBeamExtension);
gbBeamDirection.Controls.Add(tbBeamExtension);
tab.Controls.Add(gbBeamDirection);
yPos += 110;
// 材料设置
GroupBox gbBeamMaterial = new GroupBox();
gbBeamMaterial.Text = "材料设置";
gbBeamMaterial.Location = new System.Drawing.Point(20, yPos);
gbBeamMaterial.Size = new System.Drawing.Size(380, 250);
Label lblBeamMainMaterial = new Label();
lblBeamMainMaterial.Text = "主龙骨:";
lblBeamMainMaterial.Location = new System.Drawing.Point(30, 30);
lblBeamMainMaterial.AutoSize = true;
ComboBox cbBeamMainMaterial = new ComboBox();
cbBeamMainMaterial.Items.AddRange(new object[] { "3木方", "5大方", "50钢包木", "48钢管", "40方钢", "50方钢", "100方钢", "8#槽钢", "10#槽钢" });
cbBeamMainMaterial.Text = settings.BeamMainMaterial;
cbBeamMainMaterial.Location = new System.Drawing.Point(220, 25);
cbBeamMainMaterial.Width = 130;
controls.Add("cbBeamMainMaterial", cbBeamMainMaterial);
Label lblBeamSecondaryMaterial = new Label();
lblBeamSecondaryMaterial.Text = "次龙骨:";
lblBeamSecondaryMaterial.Location = new System.Drawing.Point(30, 70);
lblBeamSecondaryMaterial.AutoSize = true;
ComboBox cbBeamSecondaryMaterial = new ComboBox();
cbBeamSecondaryMaterial.Items.AddRange(new object[] { "3木方", "5大方", "50钢包木", "48钢管", "40方钢", "50方钢", "100方钢", "8#槽钢", "10#槽钢" });
cbBeamSecondaryMaterial.Text = settings.BeamSecondaryMaterial;
cbBeamSecondaryMaterial.Location = new System.Drawing.Point(220, 65);
cbBeamSecondaryMaterial.Width = 130;
controls.Add("cbBeamSecondaryMaterial", cbBeamSecondaryMaterial);
Label lblBeamSecondarySpacing = new Label();
lblBeamSecondarySpacing.Text = "次龙骨间距(mm):";
lblBeamSecondarySpacing.Location = new System.Drawing.Point(30, 110);
lblBeamSecondarySpacing.AutoSize = true;
TextBox tbBeamSecondarySpacing = new TextBox();
tbBeamSecondarySpacing.Text = settings.BeamSecondarySpacing.ToString();
tbBeamSecondarySpacing.Location = new System.Drawing.Point(220, 105);
tbBeamSecondarySpacing.Width = 130;
controls.Add("tbBeamSecondarySpacing", tbBeamSecondarySpacing);
Label lblBeamSecondaryWidth = new Label();
lblBeamSecondaryWidth.Text = "次龙骨宽(mm):";
lblBeamSecondaryWidth.Location = new System.Drawing.Point(30, 150);
lblBeamSecondaryWidth.AutoSize = true;
TextBox tbBeamSecondaryWidth = new TextBox();
tbBeamSecondaryWidth.Text = settings.BeamSecondaryWidth.ToString();
tbBeamSecondaryWidth.Location = new System.Drawing.Point(220, 145);
tbBeamSecondaryWidth.Width = 130;
controls.Add("tbBeamSecondaryWidth", tbBeamSecondaryWidth);
Label lblBeamSecondaryHeight = new Label();
lblBeamSecondaryHeight.Text = "次龙骨高(mm):";
lblBeamSecondaryHeight.Location = new System.Drawing.Point(30, 190);
lblBeamSecondaryHeight.AutoSize = true;
TextBox tbBeamSecondaryHeight = new TextBox();
tbBeamSecondaryHeight.Text = settings.BeamSecondaryHeight.ToString();
tbBeamSecondaryHeight.Location = new System.Drawing.Point(220, 185);
tbBeamSecondaryHeight.Width = 130;
controls.Add("tbBeamSecondaryHeight", tbBeamSecondaryHeight);
gbBeamMaterial.Controls.Add(lblBeamMainMaterial);
gbBeamMaterial.Controls.Add(cbBeamMainMaterial);
gbBeamMaterial.Controls.Add(lblBeamSecondaryMaterial);
gbBeamMaterial.Controls.Add(cbBeamSecondaryMaterial);
gbBeamMaterial.Controls.Add(lblBeamSecondarySpacing);
gbBeamMaterial.Controls.Add(tbBeamSecondarySpacing);
gbBeamMaterial.Controls.Add(lblBeamSecondaryWidth);
gbBeamMaterial.Controls.Add(tbBeamSecondaryWidth);
gbBeamMaterial.Controls.Add(lblBeamSecondaryHeight);
gbBeamMaterial.Controls.Add(tbBeamSecondaryHeight);
tab.Controls.Add(gbBeamMaterial);
}
private void InitializeSlabTab(TabPage tab)
{
tab.Controls.Clear();
tab.AutoScroll = true;
int yPos = 20;
// 默认板厚
GroupBox gbSlabThickness = new GroupBox();
gbSlabThickness.Text = "板厚设置";
gbSlabThickness.Location = new System.Drawing.Point(20, yPos);
gbSlabThickness.Size = new System.Drawing.Size(380, 60);
TextBox tbSlabThickness = new TextBox();
tbSlabThickness.Text = settings.SlabThickness.ToString();
tbSlabThickness.Location = new System.Drawing.Point(220, 20);
tbSlabThickness.Width = 130;
controls.Add("tbSlabThickness", tbSlabThickness);
gbSlabThickness.Controls.Add(new Label()
{
Text = "默认板厚(mm):",
Location = new System.Drawing.Point(30, 25),
AutoSize = true
});
gbSlabThickness.Controls.Add(tbSlabThickness);
tab.Controls.Add(gbSlabThickness);
yPos += 70;
// 绘制板龙骨
GroupBox gbDrawSlabSupport = new GroupBox();
gbDrawSlabSupport.Text = "绘制板龙骨";
gbDrawSlabSupport.Location = new System.Drawing.Point(20, yPos);
gbDrawSlabSupport.Size = new System.Drawing.Size(380, 60);
RadioButton rbSlabSupportYes = new RadioButton();
rbSlabSupportYes.Text = "是";
rbSlabSupportYes.Checked = settings.DrawSlabSupport;
rbSlabSupportYes.Location = new System.Drawing.Point(30, 25);
controls.Add("rbSlabSupportYes", rbSlabSupportYes);
RadioButton rbSlabSupportNo = new RadioButton();
rbSlabSupportNo.Text = "否";
rbSlabSupportNo.Checked = !settings.DrawSlabSupport;
rbSlabSupportNo.Location = new System.Drawing.Point(200, 25);
controls.Add("rbSlabSupportNo", rbSlabSupportNo);
gbDrawSlabSupport.Controls.Add(rbSlabSupportYes);
gbDrawSlabSupport.Controls.Add(rbSlabSupportNo);
tab.Controls.Add(gbDrawSlabSupport);
yPos += 70;
// 主龙骨方向
GroupBox gbSlabDirection = new GroupBox();
gbSlabDirection.Text = "主龙骨方向";
gbSlabDirection.Location = new System.Drawing.Point(20, yPos);
gbSlabDirection.Size = new System.Drawing.Size(380, 60);
RadioButton rbSlabHorizontal = new RadioButton();
rbSlabHorizontal.Text = "横向";
rbSlabHorizontal.Checked = (settings.SlabMainDirection == "横向");
rbSlabHorizontal.Location = new System.Drawing.Point(30, 25);
controls.Add("rbSlabHorizontal", rbSlabHorizontal);
RadioButton rbSlabVertical = new RadioButton();
rbSlabVertical.Text = "纵向";
rbSlabVertical.Checked = (settings.SlabMainDirection == "纵向");
rbSlabVertical.Location = new System.Drawing.Point(200, 25);
controls.Add("rbSlabVertical", rbSlabVertical);
gbSlabDirection.Controls.Add(rbSlabHorizontal);
gbSlabDirection.Controls.Add(rbSlabVertical);
tab.Controls.Add(gbSlabDirection);
yPos += 70;
// 次龙骨设置
GroupBox gbSlabSecondary = new GroupBox();
gbSlabSecondary.Text = "龙骨设置";
gbSlabSecondary.Location = new System.Drawing.Point(20, yPos);
gbSlabSecondary.Size = new System.Drawing.Size(380, 210);
Label lblSlabMainMaterial = new Label();
lblSlabMainMaterial.Text = "主龙骨材料:";
lblSlabMainMaterial.Location = new System.Drawing.Point(30, 30);
lblSlabMainMaterial.AutoSize = true;
ComboBox cbSlabMainMaterial = new ComboBox();
cbSlabMainMaterial.Items.AddRange(new object[] { "3木方", "5大方", "50钢包木", "48钢管", "40方钢", "50方钢", "100方钢", "8#槽钢", "10#槽钢" });
cbSlabMainMaterial.Text = settings.SlabMainMaterial;
cbSlabMainMaterial.Location = new System.Drawing.Point(220, 25);
cbSlabMainMaterial.Width = 130;
controls.Add("cbSlabMainMaterial", cbSlabMainMaterial);
Label lblSlabSecondaryMaterial = new Label();
lblSlabSecondaryMaterial.Text = "次龙骨材料:";
lblSlabSecondaryMaterial.Location = new System.Drawing.Point(30, 70);
lblSlabSecondaryMaterial.AutoSize = true;
ComboBox cbSlabSecondaryMaterial = new ComboBox();
cbSlabSecondaryMaterial.Items.AddRange(new object[] { "3木方", "5大方", "50钢包木", "48钢管", "40方钢", "50方钢", "100方钢", "8#槽钢", "10#槽钢" });
cbSlabSecondaryMaterial.Text = settings.SlabSecondaryMaterial;
cbSlabSecondaryMaterial.Location = new System.Drawing.Point(220, 65);
cbSlabSecondaryMaterial.Width = 130;
controls.Add("cbSlabSecondaryMaterial", cbSlabSecondaryMaterial);
Label lblSlabSpacing = new Label();
lblSlabSpacing.Text = "次龙骨间距(mm):";
lblSlabSpacing.Location = new System.Drawing.Point(30, 110);
lblSlabSpacing.AutoSize = true;
TextBox tbSlabSpacing = new TextBox();
tbSlabSpacing.Text = settings.SlabSecondarySpacing.ToString();
tbSlabSpacing.Location = new System.Drawing.Point(220, 105);
tbSlabSpacing.Width = 130;
controls.Add("tbSlabSpacing", tbSlabSpacing);
Label lblSlabSecondaryWidth = new Label();
lblSlabSecondaryWidth.Text = "次龙骨宽(mm):";
lblSlabSecondaryWidth.Location = new System.Drawing.Point(30, 150);
lblSlabSecondaryWidth.AutoSize = true;
TextBox tbSlabSecondaryWidth = new TextBox();
tbSlabSecondaryWidth.Text = settings.SlabSecondaryWidth.ToString();
tbSlabSecondaryWidth.Location = new System.Drawing.Point(220, 145);
tbSlabSecondaryWidth.Width = 130;
controls.Add("tbSlabSecondaryWidth", tbSlabSecondaryWidth);
Label lblSlabSecondaryHeight = new Label();
lblSlabSecondaryHeight.Text = "次龙骨高(mm):";
lblSlabSecondaryHeight.Location = new System.Drawing.Point(30, 190);
lblSlabSecondaryHeight.AutoSize = true;
TextBox tbSlabSecondaryHeight = new TextBox();
tbSlabSecondaryHeight.Text = settings.SlabSecondaryHeight.ToString();
tbSlabSecondaryHeight.Location = new System.Drawing.Point(220, 185);
tbSlabSecondaryHeight.Width = 130;
controls.Add("tbSlabSecondaryHeight", tbSlabSecondaryHeight);
gbSlabSecondary.Controls.Add(lblSlabMainMaterial);
gbSlabSecondary.Controls.Add(cbSlabMainMaterial);
gbSlabSecondary.Controls.Add(lblSlabSecondaryMaterial);
gbSlabSecondary.Controls.Add(cbSlabSecondaryMaterial);
gbSlabSecondary.Controls.Add(lblSlabSpacing);
gbSlabSecondary.Controls.Add(tbSlabSpacing);
gbSlabSecondary.Controls.Add(lblSlabSecondaryWidth);
gbSlabSecondary.Controls.Add(tbSlabSecondaryWidth);
gbSlabSecondary.Controls.Add(lblSlabSecondaryHeight);
gbSlabSecondary.Controls.Add(tbSlabSecondaryHeight);
tab.Controls.Add(gbSlabSecondary);
}
}
}
CS0104“Exception”是Autodesk.AutoCAD.Runtime.Exception”和System.Exception”之间的不明确的引用
CS0104“Exception”是Autodesk.AutoCAD.Runtime.Exception和System.Exception”之间的不明确的引用
CS0104“Exception”是Autodesk.AutoCAD.Runtime.Exception和System.Exception”之间的不明确的引用
“ScaffoldPole梁侧模”块参照如图,
命令: NETLOAD
命令: DB
请点击梁的第一点:
请点击梁的第二点:
请输入梁高(mm)<1000> <1000.0000>: 忽略块 _ArchTick 的重复定义。
正在重生成模型。
警告:插入的图块不是动态块,无法设置参数
请点击梁的第一点 (或按回车从上一端点继续):
请点击梁的第二点[板厚(A)升降板(S)] [A/S]:
请输入梁高(mm)<1000> <1000.0000>: 正在重生成模型。
警告:插入的图块不是动态块,无法设置参数
请点击梁的第一点 (或按回车从上一端点继续):
正在重生成模型。
最新发布