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

Ellipse that is not an AcDb.Ellipse

6 REPLIES 6
Reply
Message 1 of 7
jbooth
309 Views, 6 Replies

Ellipse that is not an AcDb.Ellipse

Our production department has CNC software that requires all ellipses to be approximated. Creating an ellipse using the system variable "PELLIPSE=1" is sufficient.

I am having issues when automating the generation of this type of ellipse using the ARX wrappers. Is there a way to generate these approximated polyline entities using the .NET library?


Currently the only way I can create the entities I need by using the Autocad command line. I would prefer not to do so if possible.

Regards,
JB
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: jbooth

There's no way to automate what the ELLIPSE command
does when PELLIPSE = 1, but why not juse execute the
command from code?

This might help:

http://www.caddzone.com/CommandLine.cs

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5553785@discussion.autodesk.com...
Our production department has CNC software that requires all ellipses to be approximated. Creating an ellipse using the system variable "PELLIPSE=1" is sufficient.

I am having issues when automating the generation of this type of ellipse using the ARX wrappers. Is there a way to generate these approximated polyline entities using the .NET library?


Currently the only way I can create the entities I need by using the Autocad command line. I would prefer not to do so if possible.

Regards,
JB
Message 3 of 7
jbooth
in reply to: jbooth

Thanks Tony, I am actually already using code similar to your example (ie: importing acedCmd from acad.exe). I just didn't want to as I have to turn off running object snaps when I create my ellipse entities.

Actually, I have a question about acedCmd(). Is it possible to overflow under reasonable use? I'm currently using it to auto-batchplot in modelspace (the AcPl namespace vexes me) and I'm worried that I may overflow the command buffer if I try to do too much at once.
Message 4 of 7
Anonymous
in reply to: jbooth

When I use the CommandLine class from my site (which
BTW, I just updated because of a few bugs), I usually do
something like this:

Command("._PLINE", "_non", , "_non", ...)

I don't really know how you're working with acedCmd()
(e.g., building a result buffer), but that can get a bit
tedious, and is why I wrote that class.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5554825@discussion.autodesk.com...
Thanks Tony, I am actually already using code similar to your example (ie: importing acedCmd from acad.exe). I just didn't want to as I have to turn off running object snaps when I create my ellipse entities.

Actually, I have a question about acedCmd(). Is it possible to overflow under reasonable use? I'm currently using it to auto-batchplot in modelspace (the AcPl namespace vexes me) and I'm worried that I may overflow the command buffer if I try to do too much at once.
Message 5 of 7
jbooth
in reply to: jbooth

Yeah it works wonders. The code I use is actually a modified version of your example I found a few weeks ago.

Thanks for the tip on "_non". I totally forgot that I could turn off running snaps temporarily in the middle of a command.

As always, thanks for your assistance, Tony.

Regards,
JB
Message 6 of 7
Anonymous
in reply to: jbooth

Have a look at this mod to that class, for one
approach to automating the "_non" business:


public static int Command( params object[] args )
{
if( AcadApp.DocumentManager.IsApplicationContext )
return 0;
int stat = 0;
int cnt = 0;
using( ResultBuffer buffer = new ResultBuffer() )
{
foreach( object o in args )
{
if( supressOSnap && ( o is Point3d || o is Point2d ) )
buffer.Add( new TypedValue( RTSTR, "_non" ) );
buffer.Add( TypedValueFromObject( o ) );
++cnt;
}
if( cnt > 0 )
stat = acedCmd( buffer.UnmanagedObject );
}
return stat;
}

private static bool supressOSnap = false;

public static bool SupressRunningObjectSnap
{
get
{
return supressOSnap;
}
set
{
supressOSnap = value;
}
}


void Example()
{
CommandLine.SupressRunningObjectSnap = true;

CommandLine.Command("._LINE", new Point3d(2,2,0),
new Point3d(4,12,0), ... );

}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5555160@discussion.autodesk.com...
Yeah it works wonders. The code I use is actually a modified version of your example I found a few weeks ago.

Thanks for the tip on "_non". I totally forgot that I could turn off running snaps temporarily in the middle of a command.

As always, thanks for your assistance, Tony.

Regards,
JB
Message 7 of 7
jbooth
in reply to: jbooth

Nice.

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