明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2112|回复: 4

jig下画直线为何不能使用正交模式

[复制链接]
发表于 2012-11-26 20:39 | 显示全部楼层 |阅读模式
jig下画直线为何不能使用正交模式.
我在sampler ()
{
//- Setup the user input controls for each sample
setUserInputControls ((AcEdJig::UserInputControls) (kNoZeroResponseAccepted| kNoNegativeResponseAccepted | kGovernedByOrthoMode)) ;
//setSpecialCursorType (kCrosshair) ;
AcEdJig::DragStatus status ;
  static AcGePoint3d axisPointTemp;
  status = acquirePoint(m_ptEnd);
  if (axisPointTemp != m_ptEnd)
   axisPointTemp = m_ptEnd;
  else if (status == AcEdJig::kNormal)
   return AcEdJig::kNoChange;
       return status;
}

中添加了kGovernedByOrthoMode,可是模式不是正交,而都是斜的。
请高手帮忙解答。
发表于 2012-11-28 13:09 | 显示全部楼层
使用带基点的acquirePoint
 楼主| 发表于 2012-12-9 09:49 | 显示全部楼层
感谢楼上的,问题解决了。
发表于 2019-8-26 17:33 | 显示全部楼层
jingjingme 发表于 2012-12-9 09:49
感谢楼上的,问题解决了。

怎么解决的,楼主!!
发表于 2019-9-5 21:34 | 显示全部楼层
zhangqi1991 发表于 2019-8-26 17:33
怎么解决的,楼主!!

比如一个直线的jig。
#include "StdAfx.h"
#include "zhflinejig.h"

CZhfLineJig::CZhfLineJig()

{
}

CZhfLineJig::~CZhfLineJig(void)
{
}

// -----------------------------------------------------------------------------
AcEdJig::DragStatus CZhfLineJig::sampler(void)
{
        DragStatus stat;
        setUserInputControls((UserInputControls)
                (AcEdJig::kAccept3dCoordinates
                |AcEdJig::kGovernedByOrthoMode
                | AcEdJig::kNoNegativeResponseAccepted
                |AcEdJig::kAnyBlankTerminatesInput
                | AcEdJig::kNullResponseAccepted
                | AcEdJig::kNoZeroResponseAccepted));

        static AcGePoint3d axisPointTemp;

        stat = acquirePoint(m_pt3dCur, m_pt3dPre);

        if (axisPointTemp != m_pt3dCur)
                axisPointTemp = m_pt3dCur;
        else if (stat == AcEdJig::kNormal)
                return AcEdJig::kNoChange;

        return stat;
}

// -----------------------------------------------------------------------------
Adesk::Boolean CZhfLineJig::update(void)
{
//         m_pZhfLine->put_m_pt3dEnd(m_pt3dCur) ;
        return Adesk::kTrue ;
}

// -----------------------------------------------------------------------------
AcDbObjectId CZhfLineJig::append(void)
{
        AcDbObjectId retCode =AcEdJig::append () ;
        return (retCode) ;
}

// -----------------------------------------------------------------------------
AcDbEntity * CZhfLineJig::entity(void) const
{       
        return m_pZhfLine ;
}

void CZhfLineJig::DoIt(void)
{
        ads_point pt1 ;
        if (RTNORM==acedGetPoint(NULL, _T("\n指定起点:"), pt1))
        {
                AcGePoint3d pt_3d_start(pt1[0], pt1[1], pt1[2]) ;
                m_pZhfLine = new ZhfLine(pt_3d_start, pt_3d_start) ;

                m_pt3dPre = pt_3d_start ;

                setDispPrompt(_T("指定终点:"));
                DragStatus es = drag();
                if (es==DragStatus::kNormal)
                {
                        m_pZhfLine->put_m_pt3dEnd(m_pt3dCur) ;
                        append();
                }
                else if (m_pZhfLine!=NULL)
                {
                        delete m_pZhfLine ;
                }
        }
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-19 14:20 , Processed in 2.581658 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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