钢构云计算
SSBIM
BIM专题
钢构专题
钢构地图APP
来源 作者:梁意 发布于 2011/8/31 9:07:22 评论(0) 有5366人阅读

为了使用户能够更好在CAD下绘制各种自定义节点图,先闻CAD工具箱为用户提供强大的自定义参数化节点绘图脚本系统。用户只需要简单了绘图系统,定义输入,输出语句,使用条件控制,循环控制语句,就可以完成以前需要大量时间、大量工序的绘图工作。先闻CAD工具箱自身附带的绘图功能全部就是使用此绘图系统。


一、准备工作


1、电脑上需安装AutoCAD,先闻CAD工具箱目前支持AutoCAD 2000到AutoCAD 2012;
2、到先闻公司网站下载并安装CAD工具箱,请到官方网站下载最新版软件,网站地址:
http://xww.ggditu.com/Textwebindex/Software/SoftwareCenter.aspx 


网页面如图:
clip_image002 


安装完成后,AutoCAD下应该有这样的界面: 


clip_image004 


二、编制绘图节点 


打开系统自带的记事本,并写入以下语句:
<?xml version="1.0" encoding="UTF-8"?>
<Modules TypeName="我的分类" >
<Module Name="模块一" Author="小明" >
    <Input> 

    </Input>    

    <Output>

    </Output>
    </Module>
</Modules>


如下图所示:
clip_image006 


现在,把焦点集中到“模块一”下面,有两个子项:“Input”和“Output”。
“Input”表示参数输入,绘图所需的参数均在此子项下定义,比如:
定义一个插入点:
<point name="InsertPoint" caption="插入点" defaultValue="0,0" />
定义长度,宽度:
<real name="length" caption="长度" defaultValue="500" />
<real name="width" caption="宽度" defaultValue="400" />
“Output” 表示绘图输出,绘图输出语句归并到此项下,比如,根据上面的输入参数,绘制一个矩形:
<line startPoint="InsertPoint+Point(length/2.0, width/2.0)"     
          endPoint=" InsertPoint+Point(length/2.0, -width/2.0)" />
<line startPoint="InsertPoint+Point(length/2.0, -width/2.0)"     
          endPoint=" InsertPoint+Point(-length/2.0, -width/2.0)" />
<line startPoint="InsertPoint+Point(-length/2.0, -width/2.0)"     
          endPoint=" InsertPoint+Point(length/2.0, width/2.0)" />
<line startPoint="InsertPoint+Point(-length/2.0, width/2.0)"
          endPoint=" InsertPoint+Point(length/2.0, width/2.0)" /> 


如下图所示:
clip_image008 


就这样,一个简单、完整的绘图节点就完成了。
  接下来保存文件测试效果,保存文件时,请注意编码格式和文件扩展名,编码格式为UTF-8编码方式,扩展名为.xml,把文件保存到工具箱安装目录下的“Modules”文件夹下面,

如下图:
clip_image010 


打开AutoCAD,点击菜单“节点图”: 


clip_image012 


出现一个对话框,就可以找到刚定义的绘图: 


clip_image014 


点击确定即可绘图了:


  clip_image002[6]

说点什么







最新评论
第1楼 undefined 发表于 2012-05-17 13:23
1983年,乔布斯对百事可乐的 CEO John Sculley 说:“Do you want to sell sugar water for the rest of your life, or do you want to change the world?”(你想卖一辈子糖水,还是改变世界?)就这样,一段传奇的合作开始了。

第1楼 undefined 发表于 2012-05-17 13:23
1983年,乔布斯对百事可乐的 CEO John Sculley 说:“Do you want to sell sugar water for the rest of your life, or do you want to change the world?”(你想卖一辈子糖水,还是改变世界?)就这样,一段传奇的合作开始了。

第1楼 undefined 发表于 2012-05-17 13:23
1983年,乔布斯对百事可乐的 CEO John Sculley 说:“Do you want to sell sugar water for the rest of your life, or do you want to change the world?”(你想卖一辈子糖水,还是改变世界?)就这样,一段传奇的合作开始了。

第1楼 undefined 发表于 2012-05-17 13:23
1983年,乔布斯对百事可乐的 CEO John Sculley 说:“Do you want to sell sugar water for the rest of your life, or do you want to change the world?”(你想卖一辈子糖水,还是改变世界?)就这样,一段传奇的合作开始了。