找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 924|回复: 4

[求助]:如何量显一个LWPOLYLIE的某个段?

[复制链接]

已领礼包: 13个

财富等级: 恭喜发财

发表于 2002-11-5 16:53:41 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
最近论坛上来了好多高手,可喜可贺,看过了NONAME朋友的几篇文章,受益匪浅。

我想要量显AcDbPolyline 的某个段,请NONAME朋友和其他高手给予帮忙,谢谢!

本帖被以下淘专辑推荐:

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2002-11-5 17:28:01 | 显示全部楼层

呵呵

客气了:)
你提出的这个问题,我也曾经探讨过,据我所知,直接而又简单的解决方案是没有的。
但是,我看到过这样一个例子,从acdbpolyline派生了一个类,每一段的颜色是不一样的,我想可以仿照这样来实现你的想法。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2002-11-5 17:32:18 | 显示全部楼层
Question
How do I create a polyline type custom entity with different attributes for each
segment?
Answer
The following sample code does this. Only the color attribute of each segment of
polyline is handled. Similarly this
method can be extended to have other attributes for each of segement of
polyline. Derive your custom object class from
AcDbPolyline.

The attachment contains the complete code for this application, here we will
just look at the worldDraw() function as follows
where XXX is the name of your custom class derived from AcDbPolyline:
Adesk::Boolean XXX::worldDraw(AcGiWorldDraw* mode)
{
        assertReadEnabled();
       
        // more code here
        // more code here

        AcGePoint3d PlinePts[2];
        Adesk::UInt16 uiColor;

        // TODO: implement this function.
        Adesk::Int8 iLen = m_ClrSeg.length();

        // walk trough each segment and set the attributes.
        for(int i =0; i < iLen; i++)
        {
                // find the vertices of the (i)th segment int PlinePts[0] and
PlinePts[1]
                this->getPointAt(i, PlinePts[0]);
                this->getPointAt(i+1, PlinePts[1]);
               
                mode->subEntityTraits().setSelectionMarker(i+1); // select
marker.
               
                // more code here
                // more code here
                mode->subEntityTraits().setColor(uiColor);// set the color

                mode->geometry().polyline(2, PlinePts);//stored in the graphics
database
        }
        // more code here
        // more code here

        return Adesk::kTrue;;
}
A sample project is attached to this solution. The key feature of the sample
project is drawing a simple custom multi colored
polyline like entity. It allows the user to pick a number of arbitrary points.
While creating the polyline it assigns
different color to each of the segment.

评分

参与人数 1D豆 +2 收起 理由
XDSoft + 2 技术引导讨论和指点奖!

查看全部评分

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2002-11-9 11:55:58 | 显示全部楼层
noname的文章是从哪里找到的?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2002-11-9 12:40:26 | 显示全部楼层
有些是前辈的资料,有些是自己的心得,有些是autodesk的资料:)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-2 19:07 , Processed in 0.503492 second(s), 42 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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