查看: 16653|回复: 11
收起左侧

[Auto CAD] 有高手知道CAD中怎么输出多段线上所有点的坐标么

  [复制链接]
发表于 2010-5-12 23:34 | 显示全部楼层 |阅读模式 来自: 中国黑龙江哈尔滨
回复

使用道具 举报

龙船学院
发表于 2010-5-26 09:29 | 显示全部楼层 来自: 中国湖北武汉
如题?
回复 支持 反对

使用道具 举报

发表于 2010-5-28 21:17 | 显示全部楼层 来自: 中国江苏苏州
先确定好坐标系,然后用list命令就可以
回复 支持 反对

使用道具 举报

发表于 2010-6-20 10:37 | 显示全部楼层 来自: 中国江苏南通
怎么没有的啊
回复 支持 反对

使用道具 举报

发表于 2010-8-23 13:19 | 显示全部楼层 来自: 中国湖北武汉
这个好像是有个命令,以前用过的,网上搜一下应该能找到
回复 支持 反对

使用道具 举报

发表于 2010-10-14 01:40 | 显示全部楼层 来自: 中国河南郑州
可以直接写个脚本文件把坐标值导入cad,但是反过来需要自己编个小程序就行了
回复 支持 反对

使用道具 举报

发表于 2010-10-14 08:33 | 显示全部楼层 来自: 中国广东深圳
3楼是正解,可能是你没选中样条曲线
回复 支持 反对

使用道具 举报

发表于 2011-10-14 14:39 | 显示全部楼层 来自: 美国

  1.             Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
  2.             TypedValue[] value = new TypedValue[1];
  3.             value.SetValue(new TypedValue((int)DxfCode.Start, "LWPOLYLINE"), 0);
  4.             SelectionFilter filter = new SelectionFilter(value);
  5.             PromptSelectionOptions option = new PromptSelectionOptions();
  6.             option.MessageForAdding = "Selection polyline for output!";
  7.             Database acdb = doc.Database;
  8.             using (Transaction tran = acdb.TransactionManager.StartTransaction())
  9.             {
  10.                 PromptSelectionResult result = ed.GetSelection(option, filter);
  11.                 //PromptSelectionResult result = ed.GetSelection(option);
  12.                 if (result.Status == PromptStatus.OK)
  13.                 {
  14.                     SelectionSet selectionSet = result.Value;
  15.                     foreach (ObjectId sel in selectionSet.GetObjectIds())
  16.                     {
  17.                         Entity entity = tran.GetObject(sel, OpenMode.ForRead) as Entity;
  18.                         Polyline pline = entity as Polyline;
  19.                         if (pline != null)
  20.                         {
  21.                             TreeNode treeNote = new TreeNode();
  22.                             DBElement element = new DBElement(type);
  23.                             treeNote.Tag = element;
  24.                             treeNote.Text = element.Type.ToString();
  25.                             Parent.Nodes.Add(treeNote);
  26.                             if (type == DBElementType.Extrusion)
  27.                             {
  28.                                 TreeNode loopNote = new TreeNode();
  29.                                 DBElement loop = new DBElement(DBElementType.Loop);
  30.                                 loopNote.Tag = loop;
  31.                                 loopNote.Text = loop.Type.ToString();
  32.                                 treeNote.Nodes.Add(loopNote);
  33.                                 for (int a = 0; a < pline.NumberOfVertices; a++)
  34.                                 {
  35.                                     if (pline.GetBulgeAt(a) != 0)
  36.                                     {
  37.                                         for (int k = 0; k < 10; k++)
  38.                                         {
  39.                                             try
  40.                                             {
  41.                                                 TreeNode newNote = new TreeNode();
  42.                                                 DBElement vert = new DBElement(DBElementType.Vertex);
  43.                                                 Point3d point = pline.GetPointAtParameter((double)a + (double)k / 10.0);
  44.                                                 vert.Position = new double[] { point.X, point.Y, point.Z };
  45.                                                 newNote.Tag = vert;
  46.                                                 newNote.Text = vert.Type.ToString();
  47.                                                 loopNote.Nodes.Add(newNote);
  48.                                             }
  49.                                             catch (Autodesk.AutoCAD.Runtime.Exception e)
  50.                                             {
  51.                                                 ed.WriteMessage(e.Message);
  52.                                             }
  53.                                         }
  54.                                     }
  55.                                                                    }
  56.                             }
复制代码
回复 支持 反对

使用道具 举报

发表于 2011-10-16 09:50 | 显示全部楼层 来自: 中国浙江舟山
回复 8# 白水6


    解释下?
回复 支持 反对

使用道具 举报

发表于 2011-10-29 22:15 | 显示全部楼层 来自: 中国江苏南京
冒昧问一句,怎么在CAD中确定坐标系,从来没用过,请高手指导下
回复 支持 反对

使用道具 举报

发表于 2011-12-9 22:26 | 显示全部楼层 来自: 中国湖北武汉
可以使用先对坐标的
回复 支持 反对

使用道具 举报

发表于 2011-12-9 22:45 | 显示全部楼层 来自: 中国江苏南京
不知道,顶一下
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|标签|免责声明|龙船社区

GMT+8, 2024-9-21 04:21

Powered by Imarine

Copyright © 2006, 龙船社区

快速回复 返回顶部 返回列表