找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1125|回复: 7

[求助]:怎么没人回我的AcEdjig啊?

[复制链接]
发表于 2004-1-9 16:45:31 | 显示全部楼层 |阅读模式

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

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

×
我的jig实现block的拖动,可是总是别的arx使用acedCommand调用就死掉。发现实在update出的pBlockReference->setBlockTransform(xform);
函数如下
// This function is called to update the entity based on the
// input values.
//
Adesk::Boolean
AsdkMyJig::update()
{
    switch (mPromptCounter) {
    case 0:
                xform=moveForm;
        break;
    case 1:
                {
                        xform.setToProduct(rotateForm,moveForm);
                }
               
        break;
    }
       
    // Now update the ellipse with the latest setting.
    //
        pBlockReference->setBlockTransform(xform);
        return Adesk::kTrue;
}

// This function must be implemented to return a pointer to
// the entity being manipulated by the jig.
//
AcDbEntity*
AsdkMyJig::entity() const
{
    return pBlockReference;
}
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 192个

财富等级: 日进斗金

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

使用道具 举报

 楼主| 发表于 2004-1-9 20:05:31 | 显示全部楼层
能给一个block的jig例子看么?
今天网络太慢,发不上来呢
class AsdkMyJig : public AcEdJig
{
public:
        AcDbObjectId m_ublkID;
    AsdkMyJig(AcDbObjectId blkId,AcGeVector3d& normal);
    virtual ~AsdkMyJig();
    void doIt();
    virtual DragStatus sampler();
    virtual Adesk::Boolean update();
    virtual AcDbEntity* entity() const;
       
private:
        AcGeMatrix3d rotateForm;
        AcGeMatrix3d moveForm;
        double mAng;
        AcDbBlockReference* pBlockReference;
        AcGeMatrix3d xform;
    AcGePoint3d mInsertPt;
    AcGeVector3d  mNormal;
    int mPromptCounter;
};

// The following defines the constructor that accepts a point to be used as the
// centerpoint of the ellipse and the current UCS normal
// vector to be used as the normal for the ellipse.  It
// also initializes the radius ratio to a small value so
// that during selection of the major axis, the ellipse
// will appear as a line.  The prompt counter is also
// initialized to 0.
//
AsdkMyJig::AsdkMyJig(AcDbObjectId blkId,AcGeVector3d& normal):mPromptCounter(0)//,mNormal(normal)
{
        m_ublkID=blkId;
        mNormal=normal;
        pBlockReference=NULL;
       
}

AsdkMyJig::~AsdkMyJig()
{
        pBlockReference->close();
}
// This function creates an AcDbEllipse object and gets the
// jig started acquiring the necessary info to properly fill
// it in.
//
void
AsdkMyJig::doIt()
{
        pBlockReference=new AcDbBlockReference;//(AcGePoint3d(0.0,0.0,0.0),m_ublkID);
        pBlockReference->setBlockTableRecord(m_ublkID);
        AcEdJig::DragStatus stat;
    // Get the major axis vector from the user.
    //
    // At this time, mPromptCounter == 0
    //
    setDispPrompt("\ninsert point: ");
    stat = drag();
       
    // Get the ellipse's radius ratio.
    //
    mPromptCounter++;   // now == 1
    setDispPrompt("\ninput angle: ");
    stat = drag();
    // Now add the ellipse to the database's current space.
    //
       
    append();
}

// This function is called by the drag function to
// acquire a sample input.
//
AcEdJig::DragStatus
AsdkMyJig::sampler()
{
    DragStatus stat;
       
    setUserInputControls((UserInputControls)
        (AcEdJig::kAccept3dCoordinates
                | AcEdJig::kNoNegativeResponseAccepted
                | AcEdJig::kNoZeroResponseAccepted));
       
    if (mPromptCounter == 0) {
               
        static AcGePoint3d axisPointTemp;
                const AcGePoint3d basePt(0.0,0.0,0.0);
        stat = acquirePoint(mInsertPt, basePt);
        if (axisPointTemp != mInsertPt)
                {
            axisPointTemp = mInsertPt;
                        AcGeVector3d Vector(mInsertPt[X],mInsertPt[Y],mInsertPt[Z]);
                        moveForm.setToTranslation(Vector);
                }
        else if (stat == AcEdJig::kNormal)
            return AcEdJig::kNoChange;
    }
    else if (mPromptCounter == 1) {
               
                static double angTemp=-1;
                //AcGePoint3d basePnt=mInsertPt;
        stat = acquireAngle(mAng, mInsertPt);
        if (angTemp != mAng)
                {
            angTemp = mAng;
                        rotateForm.setToRotation(mAng,mNormal,mInsertPt);
                }
        else if (stat == AcEdJig::kNormal)
            return AcEdJig::kNoChange;
    }
    return stat;
}

// This function is called to update the entity based on the
// input values.
//
Adesk::Boolean
AsdkMyJig::update()
{
    switch (mPromptCounter) {
    case 0:
                xform=moveForm;
        break;
    case 1:
                {
                        xform.setToProduct(rotateForm,moveForm);
                }
               
        break;
    }
       
    // Now update the ellipse with the latest setting.
    //
        pBlockReference->setBlockTransform(xform);
        return Adesk::kTrue;
}

// This function must be implemented to return a pointer to
// the entity being manipulated by the jig.
//
AcDbEntity*
AsdkMyJig::entity() const
{
    return pBlockReference;
}
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-1-18 11:15:47 | 显示全部楼层
块进行写操作时
pBlockReference->setBlockTransform(xform);
需刷新图形缓冲,一般操作中,cad会自动进行,但在jig中不会(可以问问cad为什么),
也就是说,acquireAngle得不到正确结果.
如果jig玩\完了,你没刷新图形缓冲,用acedgetpoint函数将得不到正确结果,不信可试试!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-1-18 17:04:58 | 显示全部楼层
的确没错的。只能是使用了。getpoint才行了。有没有其他的函数直接刷新缓冲区呢?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-1-19 00:18:04 | 显示全部楼层
最初由 ssh 发布
[B]的确没错的。只能是使用了。getpoint才行了。有没有其他的函数直接刷新缓冲区呢? [/B]

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

使用道具 举报

发表于 2005-2-22 21:41:36 | 显示全部楼层
楼上的那位大哥,可以把你的代码也发给我吗?谢谢
my-email:zqljgvc@hotmail.com
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2005-8-27 23:36:19 | 显示全部楼层
我在写AcEdJig程序时,发现一个低级的错误,上来一看代码就解决了
谢谢ssh提供宝贵的代码支持
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 20:17 , Processed in 0.421134 second(s), 46 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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