.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try attached code it I rewrote it completely
I added some other things take a look at
the additional functions
C6309D9E0751D165D0934D0621DFF27919
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I wan't to do your homework sorry
In the attached file all is enough for
the basic operations
you have to read some books
about C# reference for more
C6309D9E0751D165D0934D0621DFF27919
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Dear Hallex, Thanks very much for your patience andexcellent codes
I am reading some articles and books, I am sorry to cost you much time![]()
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You're welcome
Just a hint:
Don't forget to rewrite drawLineInObject function
easier yet to use double[] as start and end points as
arguments
Something like:
{code}
public static object DrawLine (object oBlock, double[] p1, double[] p2, string layer)
{
// ... the rest portion of your code is goes here.....
return oLine;
}{code}
C6309D9E0751D165D0934D0621DFF27919
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Dear Hallex:
I read your code and test in Win7 with .net2008 cad2010, runs very well ~
but in winXP .net2008 cad2008, error happens
it says cannot find the following files:
at System.Diagnostics.Process.StartWithShellExecuteEx
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at AcadTestExe.ReflectionCommands.TestACAD(String fname) in F:........
at AcadTestExe.Form1.button1 Click(Object sender. EventArgs e) in F:.......
Dear Hallex, should I add some libraries in winXP?
I am a little confused,
what language do you think is fit for me to learn cad devlopping?
ObjectARX, or VBA, or visual Lisp, or C# ?
can you introduce some reference book for me ?
right now I am more familiar with C#, C++ and matlab
Thanks for your patience and incredible codes~~~
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
On the quick glance it may occurs by User Permission
See here for more:
http://msdn.microsoft.com/en-us/library/system.dia
C6309D9E0751D165D0934D0621DFF27919
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Dear Hallex:
I test your code in anther computers
It runs well in WinXP and Win7 64bit, cad2004, 2007, 2008, 2010
you are genius, Hallex
I read many articles
and never see cad C# code without any libraries
your defined AcadApp and AcadDoc as Object
Is it the reason that can runs well in different OS and CAD ?
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
There is no magic in my crappy codes
just well-known runtime methods nothing else
Please see here for more:
http://msdn.microsoft.com/en-us/library/system.ref
Hey, cease to praise me, I same stupid, as my gray-haired @$$ ![]()
~'J'~
C6309D9E0751D165D0934D0621DFF27919
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Dear Hallex:
I never found cad C# code as powerful as yours which even need not dll or com
so I admire you ![]()
I am reading cad VBA now, and take a look at the MSDN web link you gave me
I know your code use some VBA Method, just like AddLine, Open...
My question is :
how do you know the parameters of using vba method?
For example: object AcDoc = AcadDocs.GetType().InvokeMember("Open", BindingFlags.InvokeMethod, null, AcadDocs, args, null);
you define args: args[0] = fname;(file path and name) args[1] = false;(can write dwg)
I saw in vba is :ThisDrawing.Application.Documents.Open "c:\1.dwg"
how do you know need fname together with false?
where can I find the rules?
all in C# library reference, reflection???
Re: How to open autocad.ex e in C# , PLEASE HELP!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
No, all these arguments in AutoCAD Help file
That is a lot of work to digg it from there
Say, open VBA editor in AutoCAD by Alt+F11
Then in console add dummy Sub say:
{code}
Public sub Test()
type Open in here, then select a word Open
by double click on them and press F1
See then all arguments in the Help file
End sub
{code}
Hint:
To convert any arguments to numeric values:
Open 'Immediate Window' in same editor and type here
any of AutoCad's constants preceded with question mark like this:
?acActiveViewPort
or
?acSelectionSetAll
or
??acselectionSetCrossingPolygon
or
?acMiddleCenter ETC, ETC
Then press Enter
You should see a numeric equivalent of this constant
in the same window next line below
So nothing smart it's just a lot of work, you have to digg deeper yourself
C6309D9E0751D165D0934D0621DFF27919



