.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

transient line with dist command

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
joantopo
514 Views, 4 Replies

transient line with dist command

Hi, I have my own "dist" command.

 

I pick 2 points and I show it in command line(by prompt).

 

However, I would like to show the line (graphicsInterface.Transient) during the process. When I pick the first point and finally pick the second point exactly as "dist" command of AutoCAD.

 

Thanks in advance.

 

Regards.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
4 REPLIES 4
Message 2 of 5
Jeff_M
in reply to: joantopo

Both the PromptPointOptions and PromptDistanceOptions have the properties "BasePoint", "UseBasePoint", & "UseDashedLine". This is what you use to get that rubberband line.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 5
_gile
in reply to: joantopo

Hi,

 

Look at the PromptPointOptions.BasePoint and PromptPointOptions.UseBasePoint properties.

 

Here's a little sample:

 

        [CommandMethod("Dist")]
        public void GetdDstance()
        {
            Editor ed = AcAp.DocumentManager.MdiActiveDocument.Editor;  
            PromptPointOptions opts = new PromptPointOptions("\nSpecify the first point: ");
            PromptPointResult reslt = ed.GetPoint(opts);
            if (reslt.Status == PromptStatus.OK)
            {
                Point3d p1 = reslt.Value;
                opts.Message = "\nSpecify the second point: ";
                opts.BasePoint = p1;
                opts.UseBasePoint = true;
                reslt = ed.GetPoint(opts);
                if (reslt.Status != PromptStatus.OK)
                {
                    Point3d p2 = reslt.Value;
                    ed.WriteMessage("\nDistance: " + Converter.DistanceToString(p1.DistanceTo(p2)));
                }
            }
        }

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 4 of 5
joantopo
in reply to: _gile

Is this:

http://spiderinnet1.typepad.com/blog/2012/03/autocad-net-entityjig-jig-line-by-start-and-end-points....

 

But I don´t want to use a specific class;

 

I want to jig the temporary line until click the second point.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 5 of 5
joantopo
in reply to: joantopo

Yes.

It is ".UseBasePoint".

 

Thanks.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost