<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Draw line with lineweigth by AcEdInputPointMonitor class in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/draw-line-with-lineweigth-by-acedinputpointmonitor-class/m-p/14033998#M44216</link>
    <description>&lt;P&gt;I have a class &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;CMajUsekMonitor&lt;/STRONG&gt; &lt;/EM&gt;&lt;/U&gt;derived from&amp;nbsp;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;AcEdInputPointMonitor&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In method&amp;nbsp;...&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;monitorInputPoint(const AcEdInputPoint &amp;amp;input, AcEdInputPointMonitorResult &amp;amp;output)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt; I need to draw temporay line, and for amhasizing I need it draw with bigger thickness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try this, but it doesnot work (in drawing I have LWDISPLAY on):&lt;/P&gt;&lt;P&gt;How force Autocad to draw thick line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Acad::ErrorStatus CMajUsekMonitor::monitorInputPoint(const AcEdInputPoint &amp;amp;input, AcEdInputPointMonitorResult &amp;amp;output)
{
	if (input.pointComputed())
	{
		getNearest(input.computedPoint());
		auto &amp;amp;traits = input.drawContext()-&amp;gt;subEntityTraits();

		traits.setColor(2);
		traits.setLineWeight(AcDb::kLnWt140);
		traits.setSelectionMarker(2);

		AcGePoint3d pts[2] = { asPnt3d(m_itLom-&amp;gt;bod), asPnt3d((m_itLom + 1)-&amp;gt;bod) };
		input.drawContext()-&amp;gt;geometry().polyline(2, pts);

		if (m_bInfo)
			acedGrText(-1, m_itLom-&amp;gt;GetInfo(), 0);
	}
	return Acad::eOk;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Feb 2026 16:05:38 GMT</pubDate>
    <dc:creator>majklha</dc:creator>
    <dc:date>2026-02-26T16:05:38Z</dc:date>
    <item>
      <title>Draw line with lineweigth by AcEdInputPointMonitor class</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/draw-line-with-lineweigth-by-acedinputpointmonitor-class/m-p/14033998#M44216</link>
      <description>&lt;P&gt;I have a class &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;CMajUsekMonitor&lt;/STRONG&gt; &lt;/EM&gt;&lt;/U&gt;derived from&amp;nbsp;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;AcEdInputPointMonitor&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In method&amp;nbsp;...&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;monitorInputPoint(const AcEdInputPoint &amp;amp;input, AcEdInputPointMonitorResult &amp;amp;output)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt; I need to draw temporay line, and for amhasizing I need it draw with bigger thickness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try this, but it doesnot work (in drawing I have LWDISPLAY on):&lt;/P&gt;&lt;P&gt;How force Autocad to draw thick line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Acad::ErrorStatus CMajUsekMonitor::monitorInputPoint(const AcEdInputPoint &amp;amp;input, AcEdInputPointMonitorResult &amp;amp;output)
{
	if (input.pointComputed())
	{
		getNearest(input.computedPoint());
		auto &amp;amp;traits = input.drawContext()-&amp;gt;subEntityTraits();

		traits.setColor(2);
		traits.setLineWeight(AcDb::kLnWt140);
		traits.setSelectionMarker(2);

		AcGePoint3d pts[2] = { asPnt3d(m_itLom-&amp;gt;bod), asPnt3d((m_itLom + 1)-&amp;gt;bod) };
		input.drawContext()-&amp;gt;geometry().polyline(2, pts);

		if (m_bInfo)
			acedGrText(-1, m_itLom-&amp;gt;GetInfo(), 0);
	}
	return Acad::eOk;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2026 16:05:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/draw-line-with-lineweigth-by-acedinputpointmonitor-class/m-p/14033998#M44216</guid>
      <dc:creator>majklha</dc:creator>
      <dc:date>2026-02-26T16:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Draw line with lineweigth by AcEdInputPointMonitor class</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/draw-line-with-lineweigth-by-acedinputpointmonitor-class/m-p/14034758#M44217</link>
      <description>&lt;P&gt;I could not get it to work either; I also tried just drawing a polyline in geo.draw()&lt;/P&gt;&lt;P&gt;You may be able to simulate it though, a wacky proof of concept using polygon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# C++ hint
# rt = ads_getvar(L"VIEWSIZE", &amp;amp;var);
# view-&amp;gt;setHeight(var.resval.rreal);

# resbuf rbScreen;
# if (acedGetVar(_T("SCREENSIZE"), &amp;amp;rbScreen) == RTNORM)
# {
#     double pixelX = rbScreen.resval.rpoint[X];
#     double pixelY = rbScreen.resval.rpoint[Y];
#     if (pixelY != 0)
#     {
#         view-&amp;gt;setWidth(var.resval.rreal * (pixelX / pixelY));
#     }
# }

# do this in mfc
display = wx.Display(0)
geometry = display.GetGeometry()
screen_res_y = float(geometry.Height)

class MyPointMonitor(Ed.InputPointMonitor):
    def __init__(self):
        Ed.InputPointMonitor.__init__(self)

    def simulatePolygon(self, a: Ge.Point3d, b: Ge.Point3d, pixel_width: float = 5):
        v = Ed.Core.getCurrentView()
        thickness = (v.height() / screen_res_y) * pixel_width
        vec: Ge.Vector3d = b - a
        if vec.length() &amp;lt; 1e-6:
            return []
        perp_vec = Ge.Vector3d(-vec.y, vec.x, 0).normal()
        offset = thickness / 2.0
        p1 = a + (perp_vec * offset)
        p2 = a - (perp_vec * offset)
        p3 = b - (perp_vec * offset)
        p4 = b + (perp_vec * offset)
        return [p1, p4, p3, p2, p1]

    def monitorInputPoint(self, input: Ed.InputPoint, output):
        try:
            ents = input.pickedEntities()
            if len(ents) == 0:
                return

            p = input.rawPoint()
            geo = input.drawContext().geometry()
            tr = input.drawContext().subEntityTraits()
            tr.setFillType(Gi.FillType.kAcGiFillAlways)

            tr.setColor(3)
            plypnts = self.simulatePolygon(
                p, p + (Ge.Point3d(0, 0, 0) - Ge.Point3d(100, 100, 0))
            )
            geo.polygon(plypnts)

            tr.setColor(1)
            plypnts = geo.polyline(
                [p, p + (Ge.Point3d(100, 100, 0) - Ge.Point3d(0, 0, 0))]
            )

        except Exception as err:
            print(err)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pymon.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1621777iE79D91C83F60F949/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pymon.png" alt="pymon.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 27 Feb 2026 01:25:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/draw-line-with-lineweigth-by-acedinputpointmonitor-class/m-p/14034758#M44217</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-27T01:25:02Z</dc:date>
    </item>
  </channel>
</rss>

