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

Polyline2d Question

20 REPLIES 20
Reply
Message 1 of 21
GTVic
1135 Views, 20 Replies

Polyline2d Question

When creating a new Polyline2d, I am assuming that the number of bulges should be 1 less than the number of points? So if you have only 3 points, you have two bulge factors that represent the arcs between points 1/2 and points 2/3. Is that correct?

{code}PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0, PolyBulges){code}

Also, just a general question, what does the SetDatabaseDefaults function do? If it sets the default layer, color, linetype, etc then I think the following lines of example code are not in the correct order and the SetDatabase defaults function should be moved before the ColorIndex line.

{code}
PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0, PolyBulges)
PolyEnt.ColorIndex = 3
Using Trans As Transaction = AcadDoc.TransactionManager.StartTransaction()
btr = Trans.GetObject(AcadDoc.Database.CurrentSpaceId, OpenMode.ForWrite)
btr.AppendEntity(PolyEnt)
PolyEnt.SetDatabaseDefaults()
Trans.AddNewlyCreatedDBObject(PolyEnt, True)
Trans.Commit()
End Using
{code}

Thanks
20 REPLIES 20
Message 2 of 21
chiefbraincloud
in reply to: GTVic


Bulges should have the same number of elements as the vertices. for your 3 point example, bulge(0) is the segment between point1/2 next is point2/3 then between point3/1. If the polyline is closed, that segment between the last point and the first point can have a bulge.

Honestly, I can't think of any polyline I've tried to apply bulges to that wasn't closed, but I have created open polylines where the bulges were all 0, and I still declare the bulges to be the same size as the points.

As far as SetDatabaseDefaults, I have seen it in a few examples, but I have not called it anywhere in my code. The Help file has this to say:



This function sets the entity's {Color ,Layer ,Linetype, Linetype scale ,Visibility ,Plot style name ,Line weight} to the default values of the database in which the entity currently resides or, if the entity is not part of a database yet, the current database in the AutoCAD editor is used. (There is also an overload which accepts a database parameter)



But in my experience this all happens automatically. If you don't set the color or layer of an object when you create it, it goes on the Current layer, with the current "CECOLOR", "CELTYPE", "CELTSCALE"...

I never bothered to look at the plotstylename or lineweight, because we do not use entity based plot styles.

Dave O.                                                                  Sig-Logos32.png
Message 3 of 21
Anonymous
in reply to: GTVic

Bluges correspond to segments.

If the polyline is closed, the number of
segments equals the number of vertices.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6146244@discussion.autodesk.com...
When creating a new Polyline2d, I am assuming that the number of bulges
should be 1 less than the number of points? So if you have only 3 points,
you have two bulge factors that represent the arcs between points 1/2 and
points 2/3. Is that correct? {code}PolyEnt = New
Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0,
PolyBulges){code} Also, just a general question, what does the
SetDatabaseDefaults function do? If it sets the default layer, color,
linetype, etc then I think the following lines of example code are not in
the correct order and the SetDatabase defaults function should be moved
before the ColorIndex line. {code} PolyEnt = New
Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, True, 0.0, 0.0,
PolyBulges) PolyEnt.ColorIndex = 3 Using Trans As Transaction =
AcadDoc.TransactionManager.StartTransaction() btr =
Trans.GetObject(AcadDoc.Database.CurrentSpaceId, OpenMode.ForWrite)
btr.AppendEntity(PolyEnt) PolyEnt.SetDatabaseDefaults()
Trans.AddNewlyCreatedDBObject(PolyEnt, True) Trans.Commit() End Using {code}
Thanks
Message 4 of 21
Hallex
in reply to: GTVic

Here is a part of my project that will draw what you need
{code}
static public void DrawRoundedFrame()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;

using (Transaction tr =
db.TransactionManager.StartTransaction())
{

try
{
BlockTableRecord btr = tr.GetObject(db.CurrentSpaceId,
OpenMode.ForWrite, false) as BlockTableRecord;

PromptPointOptions ppo = new PromptPointOptions(Environment.NewLine +
"Pick lower left corner point:");
PromptPointResult prs = ed.GetPoint(ppo);

if (prs.Status != PromptStatus.OK || prs.Status == PromptStatus.Error)
{
return;
}
Point3d p1 = prs.Value;
Point3d p3;
PromptCornerOptions ppc = new PromptCornerOptions(Environment.NewLine +
"Pick upper right corner: ", p1);
PromptPointResult prc = ed.GetCorner(ppc);
if (prc.Status != PromptStatus.OK || prc.Status == PromptStatus.Error)
{
return;
}

p3 = prc.Value;

Double length = Math.Abs(p1.X - p3.X);
double width = Math.Abs(p1.Y - p3.Y);

Point3d p2 = new Point3d(p1.X + length, p1.Y + width, 0.0);
Point3d p4 = new Point3d(p1.X, p2.Y, 0.0);

PromptDoubleOptions ppd = new PromptDoubleOptions(Environment.NewLine +
"Enter fillet radius: ");

ppd.DefaultValue = 10.0;

PromptDoubleResult pdr = ed.GetDouble(ppd);

if (pdr.Status != PromptStatus.OK ||
pdr.Status == PromptStatus.Error ||
pdr.Status != PromptStatus.Keyword)
{
return;
}
Double rad = pdr.Value;
if (rad > width / 2 || rad > length / 2)
{
MessageBox.Show("Radius must be less then half of smalles side of rectangle");
return;
}

Double bulge = (Math.Tan((90 / 4) * Math.PI / 180));

Point3dCollection points = new Point3dCollection();

Point3d pt1 = new Point3d(p1.X, p1.Y + rad, 0.0);
Point3d pt2 = new Point3d(p1.X + rad, p1.Y, 0.0);
Point3d pt3 = new Point3d(p2.X - rad, pt2.Y, 0.0);
Point3d pt4 = new Point3d(p2.X, pt2.Y + rad, 0.0);
Point3d pt5 = new Point3d(pt4.X, p2.Y - rad, 0.0);
Point3d pt6 = new Point3d(pt3.X, p2.Y, 0.0);
Point3d pt7 = new Point3d(pt2.X, p2.Y, 0.0);
Point3d pt8 = new Point3d(p1.X, pt5.Y, 0.0);

points.Add(pt1);
points.Add(pt2);
points.Add(pt3);
points.Add(pt4);
points.Add(pt5);
points.Add(pt6);
points.Add(pt7);
points.Add(pt8);


DoubleCollection bulges = new DoubleCollection();

double[] bulgelist = { bulge, 0, bulge, 0, bulge, 0, bulge, 0 };

bulges.AddRange(bulgelist);

Polyline2d pline = new Polyline2d(Poly2dType.SimplePoly, points, 0.0, true, 0.0, 0.0, bulges);

btr.AppendEntity(pline);
tr.AddNewlyCreatedDBObject(pline, true);

ed.Regen();
tr.Commit();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
}
}{code}

Hope that helps

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 5 of 21
Hallex
in reply to: GTVic

Sorry my bad, here is edite version 🙂

{code}
static public void DrawRoundedFrame()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;

using (Transaction tr =
db.TransactionManager.StartTransaction())
{

try
{
BlockTableRecord btr = tr.GetObject(db.CurrentSpaceId,
OpenMode.ForWrite, false) as BlockTableRecord;

PromptPointOptions ppo = new PromptPointOptions(Environment.NewLine +
"Pick lower left corner point:");
PromptPointResult prs = ed.GetPoint(ppo);

if (prs.Status != PromptStatus.OK || prs.Status == PromptStatus.Error)
{
return;
}
Point3d p1 = prs.Value;
Point3d p3;
PromptCornerOptions ppc = new PromptCornerOptions(Environment.NewLine +
"Pick upper right corner: ", p1);
PromptPointResult prc = ed.GetCorner(ppc);
if (prc.Status != PromptStatus.OK || prc.Status == PromptStatus.Error)
{
return;
}

p3 = prc.Value;

Double length = Math.Abs(p1.X - p3.X);
double width = Math.Abs(p1.Y - p3.Y);

Point3d p2 = new Point3d(p3.X, p1.Y, 0.0);
Point3d p4 = new Point3d(p1.X, p3.Y, 0.0);

PromptDoubleOptions ppd = new PromptDoubleOptions(Environment.NewLine +
"Enter fillet radius: ");
ppd.AllowArbitraryInput = true;
ppd.DefaultValue = 10.0;

PromptDoubleResult pdr = ed.GetDouble(ppd);

if (pdr.Status != PromptStatus.OK ||
pdr.Status == PromptStatus.Error)
{
return;
}
Double rad = pdr.Value;
if (rad > width / 2 || rad > length / 2)
{
MessageBox.Show("Radius must be less then half\nof the smallest side of rectangle");
return;
}

Double bulge = (Math.Tan((90 / 4) * Math.PI / 180));

Point3dCollection points = new Point3dCollection();

Point3d pt1 = new Point3d(p1.X, p1.Y + rad, 0.0);
Point3d pt2 = new Point3d(p1.X + rad, p1.Y, 0.0);
Point3d pt3 = new Point3d(p2.X - rad, p1.Y, 0.0);
Point3d pt4 = new Point3d(p2.X, p1.Y + rad, 0.0);
Point3d pt5 = new Point3d(p2.X, p3.Y - rad, 0.0);
Point3d pt6 = new Point3d(pt3.X, p3.Y, 0.0);
Point3d pt7 = new Point3d(pt2.X, p3.Y, 0.0);
Point3d pt8 = new Point3d(p1.X, pt5.Y, 0.0);

points.Add(pt1);
points.Add(pt2);
points.Add(pt3);
points.Add(pt4);
points.Add(pt5);
points.Add(pt6);
points.Add(pt7);
points.Add(pt8);


DoubleCollection bulges = new DoubleCollection();

double[] bulgelist = { bulge, 0, bulge, 0, bulge, 0, bulge, 0 };

bulges.AddRange(bulgelist);

Polyline2d pline = new Polyline2d(Poly2dType.SimplePoly, points, 0.0, true, 0.0, 0.0, bulges);

btr.AppendEntity(pline);
tr.AddNewlyCreatedDBObject(pline, true);

ed.Regen();
tr.Commit();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
}
}{code}

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 6 of 21
Anonymous
in reply to: GTVic

People using newsreaders cannot read your code.

If you want more help, include you code attached as
a text file.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6149906@discussion.autodesk.com...
Sorry my bad, here is edite version 🙂 {code} static public void
DrawRoundedFrame() { Document doc =
acadApp.DocumentManager.MdiActiveDocument; Database db = doc.Database;
Editor ed = doc.Editor; using (Transaction tr =
db.TransactionManager.StartTransaction()) { try { BlockTableRecord btr =
tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite, false) as
BlockTableRecord; PromptPointOptions ppo = new
PromptPointOptions(Environment.NewLine + "Pick lower left corner point:");
PromptPointResult prs = ed.GetPoint(ppo); if (prs.Status != PromptStatus.OK
|| prs.Status == PromptStatus.Error) { return; } Point3d p1 = prs.Value;
Point3d p3; PromptCornerOptions ppc = new
PromptCornerOptions(Environment.NewLine + "Pick upper right corner: ", p1);
PromptPointResult prc = ed.GetCorner(ppc); if (prc.Status != PromptStatus.OK
|| prc.Status == PromptStatus.Error) { return; } p3 = prc.Value; Double
length = Math.Abs(p1.X - p3.X); double width = Math.Abs(p1.Y - p3.Y);
Point3d p2 = new Point3d(p3.X, p1.Y, 0.0); Point3d p4 = new Point3d(p1.X,
p3.Y, 0.0); PromptDoubleOptions ppd = new
PromptDoubleOptions(Environment.NewLine + "Enter fillet radius: ");
ppd.AllowArbitraryInput = true; ppd.DefaultValue = 10.0; PromptDoubleResult
pdr = ed.GetDouble(ppd); if (pdr.Status != PromptStatus.OK || pdr.Status ==
PromptStatus.Error) { return; } Double rad = pdr.Value; if (rad > width / 2
|| rad > length / 2) { MessageBox.Show("Radius must be less then half\nof
the smallest side of rectangle"); return; } Double bulge = (Math.Tan((90 /
4) * Math.PI / 180)); Point3dCollection points = new Point3dCollection();
Point3d pt1 = new Point3d(p1.X, p1.Y + rad, 0.0); Point3d pt2 = new
Point3d(p1.X + rad, p1.Y, 0.0); Point3d pt3 = new Point3d(p2.X - rad, p1.Y,
0.0); Point3d pt4 = new Point3d(p2.X, p1.Y + rad, 0.0); Point3d pt5 = new
Point3d(p2.X, p3.Y - rad, 0.0); Point3d pt6 = new Point3d(pt3.X, p3.Y, 0.0);
Point3d pt7 = new Point3d(pt2.X, p3.Y, 0.0); Point3d pt8 = new Point3d(p1.X,
pt5.Y, 0.0); points.Add(pt1); points.Add(pt2); points.Add(pt3);
points.Add(pt4); points.Add(pt5); points.Add(pt6); points.Add(pt7);
points.Add(pt8); DoubleCollection bulges = new DoubleCollection(); double[]
bulgelist = { bulge, 0, bulge, 0, bulge, 0, bulge, 0 };
bulges.AddRange(bulgelist); Polyline2d pline = new
Polyline2d(Poly2dType.SimplePoly, points, 0.0, true, 0.0, 0.0, bulges);
btr.AppendEntity(pline); tr.AddNewlyCreatedDBObject(pline, true);
ed.Regen(); tr.Commit(); } catch (System.Exception ex) {
MessageBox.Show(ex.StackTrace); } } }{code} ~'J'~
Message 7 of 21
Hallex
in reply to: GTVic

Agreed, thanks

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 8 of 21
Hallex
in reply to: GTVic

Agreed, thanks

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 9 of 21
GTVic
in reply to: GTVic

Thanks for the assistance. For the following code, the answer is that PolyBulges.Count must equal PolyPoints.Count regardless of the value of the Closed variable. Otherwise, you will get a hard crash or, as Autodesk likes to call it, a "quick exit".

{code}
Dim Closed as Boolean
Dim PolyEnt As Polyline2d
Dim PolyPoints As Point3dCollection
Dim PolyBulges As DoubleCollection

PolyEnt = New Polyline2d(Poly2dType.SimplePoly, PolyPoints, 0.0, Closed, 0.0, 0.0, PolyBulges)
{code}
Message 10 of 21
GTVic
in reply to: GTVic

I need to read the bulge values in an existing polyline. Could someone point me in the right direction? Also, Is it possible to get an array of all the vertices and bulge factors? Right now I am using GetPointAtParameter.
Message 11 of 21
Anonymous
in reply to: GTVic

Out of curiosity, do you find the docs to be unclear on this?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6158002@discussion.autodesk.com...
I need to read the bulge values in an existing polyline. Could someone point
me in the right direction? Also, Is it possible to get an array of all the
vertices and bulge factors? Right now I am using GetPointAtParameter.
Message 12 of 21
GTVic
in reply to: GTVic

Somewhat, GetPointAtParameter is not listed in the Visual Studio integrated help except as it applies to curves. The arxdev(.net).chm help file has interesting topics but no actual content for some reason. Unless you know the name of the function you are looking for, it is not easy.
Message 13 of 21
GTVic
in reply to: GTVic

I was trying to support the older 2D polylines, apparently that functionality is not included for those objects or is harder to find. For the newer LW polylines, there are some simple GetBulge, etc type functions that make this very easy.
Message 14 of 21
Anonymous
in reply to: GTVic

For 'heavy' polylines, you get the vertex data, bulge and segment widths
from Vertex2d entities (e.g., 'VERTEX' entity in DXF).

You just use something like:

{code}

foreach( ObjectId vertexId in myPolyline2d )
{
// Open the vertex and get its data
}

{code}


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6158129@discussion.autodesk.com...
I was trying to support the older 2D polylines, apparently that
functionality is not included for those objects or is harder to find. For
the newer LW polylines, there are some simple GetBulge, etc type functions
that make this very easy.
Message 15 of 21
GTVic
in reply to: GTVic

Thanks for the info. Here is some code for anyone that is interested. One thing that could be improved is the AppActivate based on a window handle or something else other than the caption text.

Code to select and parse polyline (lwpolyline) or polyline2d (old style polyline) vertices:

{code}
Dim peoGetPoly As New PromptEntityOptions(vbLf + "Select a 2D polyline: ")
Dim perGetResult As PromptEntityResult
Dim LockObject As DocumentLock
Dim GenericObject As DBObject, VertexID As ObjectId
Dim PolyOld As Polyline2d, PolyNew As Polyline
Dim VertexPT As Point3d, VertexObj As Vertex2d
Dim d As Integer

TrackerDoc = Application.DocumentManager.MdiActiveDocument

LockObject = TrackerDoc.LockDocument()

peoGetPoly.SetRejectMessage("(object is not a 2D polyline)")
peoGetPoly.AddAllowedClass(GetType(Polyline2d), True)
peoGetPoly.AddAllowedClass(GetType(Polyline), True)

Me.Hide()
AppActivate(Autodesk.AutoCAD.ApplicationServices.Application.MainWindow.Text)

perGetResult = TrackerDoc.Editor.GetEntity(peoGetPoly)

Me.Show()
System.Windows.Forms.Application.DoEvents()

If perGetResult.ObjectId = ObjectId.Null Then
' No polyline selected
LockObject.Dispose()
Exit Sub
End If

Using Trans As Transaction = TrackerDoc.TransactionManager.StartTransaction()
GenericObject = Trans.GetObject(perGetResult.ObjectId, OpenMode.ForRead)
If GenericObject IsNot Nothing Then
If TypeOf (GenericObject) Is Polyline2d Then
PolyOld = Trans.GetObject(perGetResult.ObjectId, OpenMode.ForRead)
For Each VertexID In PolyOld
VertexObj = Trans.GetObject(VertexID, OpenMode.ForRead)
'X = VertexObj.Position.X
'Y = VertexObj.Position.Y
'Bulge = VertexObj.Bulge
Next
'Length = PolyOld.Length
Else
PolyNew = Trans.GetObject(perGetResult.ObjectId, OpenMode.ForRead)
For d = 0 To PolyNew.NumberOfVertices - 1
VertexPT = PolyNew.GetPoint3dAt(d)
'X = VertexPT.X
'Y = VertexPT.Y
'Bulge = PolyNew.GetBulgeAt(d)
Next d
'Length = PolyNew.Length
End If
End If
End Using

LockObject.Dispose()
{code}
Message 16 of 21
chiefbraincloud
in reply to: GTVic


This is the solution I have for Activating or Focusing on a Window. Put this declaration in your code somewhere accessible.



<System.Runtime.InteropServices.DllImport("user32.dll")> _



Shared Function SetFocus(ByVal hwnd As IntPtr) As IntPtr



End Function



Then you can call it with SetFocus(DocumentObject.UnmanagedObject) or SetFocus(Application.MainWindow.Handle)

Dave O.                                                                  Sig-Logos32.png
Message 17 of 21
Anonymous
in reply to: GTVic

There should be no need to activate any window in your code.

The managed runtime will automatically hide your form when you make a call
to any API that prompts the user on the command line (e.g., GetEntity(),
GetPoint() etc.), and will automatically show it after the input is
acquired, so there should be no reason do any kind of window activation
unless there's something funky going on that you haven't mentioned.

Remove the Me.Hide, and Me.Show and AutoCAD should automatically hide/show
your form (if it is a modal form).

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6158912@discussion.autodesk.com...
Thanks for the info. Here is some code for anyone that is interested. One
thing that could be improved is the AppActivate based on a window handle or
something else other than the caption text. Code to select and parse
polyline (lwpolyline) or polyline2d (old style polyline) vertices: {code}
Dim peoGetPoly As New PromptEntityOptions(vbLf + "Select a 2D polyline: ")
Dim perGetResult As PromptEntityResult Dim LockObject As DocumentLock Dim
GenericObject As DBObject, VertexID As ObjectId Dim PolyOld As Polyline2d,
PolyNew As Polyline Dim VertexPT As Point3d, VertexObj As Vertex2d Dim d As
Integer TrackerDoc = Application.DocumentManager.MdiActiveDocument
LockObject = TrackerDoc.LockDocument() peoGetPoly.SetRejectMessage("(object
is not a 2D polyline)") peoGetPoly.AddAllowedClass(GetType(Polyline2d),
True) peoGetPoly.AddAllowedClass(GetType(Polyline), True) Me.Hide()
AppActivate(Autodesk.AutoCAD.ApplicationServices.Application.MainWindow.Text)
perGetResult = TrackerDoc.Editor.GetEntity(peoGetPoly) Me.Show()
System.Windows.Forms.Application.DoEvents() If perGetResult.ObjectId =
ObjectId.Null Then ' No polyline selected LockObject.Dispose() Exit Sub End
If Using Trans As Transaction =
TrackerDoc.TransactionManager.StartTransaction() GenericObject =
Trans.GetObject(perGetResult.ObjectId, OpenMode.ForRead) If GenericObject
IsNot Nothing Then If TypeOf (GenericObject) Is Polyline2d Then PolyOld =
Trans.GetObject(perGetResult.ObjectId, OpenMode.ForRead) For Each VertexID
In PolyOld VertexObj = Trans.GetObject(VertexID, OpenMode.ForRead) 'X =
VertexObj.Position.X 'Y = VertexObj.Position.Y 'Bulge = VertexObj.Bulge Next
'Length = PolyOld.Length Else PolyNew =
Trans.GetObject(perGetResult.ObjectId, OpenMode.ForRead) For d = 0 To
PolyNew.NumberOfVertices - 1 VertexPT = PolyNew.GetPoint3dAt(d) 'X =
VertexPT.X 'Y = VertexPT.Y 'Bulge = PolyNew.GetBulgeAt(d) Next d 'Length =
PolyNew.Length End If End If End Using LockObject.Dispose() {code}
Message 18 of 21
GTVic
in reply to: GTVic

Thanks for the code and tips. This one is a modeless form though...
Message 19 of 21
Anonymous
in reply to: GTVic

Try setting the form's Visible property to false rather than
calling Hide().

I have no problem hiding a modeless form and do not
need to activate the AutoCAD window when I do that.

I also assume you're calling the ShowModelessDialog()
method to show your form initially?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6159012@discussion.autodesk.com...
Thanks for the code and tips. This one is a modeless form though...
Message 20 of 21
GTVic
in reply to: GTVic

Thanks, I tested using ShowModelessDialog. This gives you an "always on top" position on the main AutoCAD window and then you don't need to activate the AutoCAD window.

I was using .Show and that requires the setfocus code because selecting the dialog does not activate the AutoCAD window below as with ShowModelessDialog.

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