Lazarus

Miscellaneous => Suggestions => Topic started by: Avishai on September 19, 2011, 01:44:00 pm

Title: Autocad and Lazarus/FPC?
Post by: Avishai on September 19, 2011, 01:44:00 pm
Has anyone looked in to the possibility of approaching AutoDesk about making Lazarus/FPC a programming language for Autocad?  I think it would almost instantly increase the popularity of Lazarus/FPC and I know it would be a huge improvement for Autocad.  It seems to me that all that would be needed is a means of communicating with Autocad and a library.
Title: Re: Autocad and Lazarus/FPC?
Post by: BlueIcaro on September 19, 2011, 02:56:40 pm
Hello, If someone wants to start, I read that Autocad files, are Ascii files, with instruccions to "render" the files. More info in Autocad website.

/BlueIcaro
Title: Re: Autocad and Lazarus/FPC?
Post by: Avishai on September 19, 2011, 04:46:52 pm
I just looked at an Acad DWG file.  It is not a text file.
Title: Re: Autocad and Lazarus/FPC?
Post by: BlueIcaro on September 19, 2011, 05:15:14 pm
Read this:
http://libreplanet.org/wiki/LibreDWG (http://libreplanet.org/wiki/LibreDWG)

/BlueIcaro
Title: Re: Autocad and Lazarus/FPC?
Post by: TurboRascal on September 19, 2011, 05:39:59 pm
Why would you wish to interface to AutoCAD? Especially since it is a Windows-only solution, so the full potential of Laz/FPC couldn't be unleashed...
Title: Re: Autocad and Lazarus/FPC?
Post by: Avishai on September 19, 2011, 06:01:06 pm
Actually, Acad also runs on Mac.  The reason I would like to see it is that Acad only has 2 languages that it supports.  VB and Lisp.  Both are poor choices in my opinion.  I think you have to buy VB but I may be wrong.  There are ways to make Python work with Acad and maybe others, but I have not tried them and AutoDesk does not support them.  Anyway, it was an idea.  If it increased the popularity of LAzarus/FPC and maybe got some corporate sponsorship, would that be a bad thing?
Title: Re: Autocad and Lazarus/FPC?
Post by: TurboRascal on September 19, 2011, 07:50:21 pm
You are right, that might be a good idea, but sounds quite hard to implement...
Title: Re: Autocad and Lazarus/FPC?
Post by: Avishai on September 19, 2011, 08:05:27 pm
I think it is easier than you might think.  From Acad 2000 to Acad 2007 I was able to run Acad with Delphi 6.  I could draw any object and some of the objects were complex objects.  I could switch tabs, set up MViews, almost anything I needed to do.  If Acad provided the hook to the command processor, that would be all you needed.
Title: Re: Autocad and Lazarus/FPC?
Post by: Sora-Kun on September 19, 2011, 08:44:50 pm
The solution is simple;
Make an AutoCad clone in Lazarus-FPC :D
That's my philosophy, if nothing suites you, make it your self!
Title: Re: Autocad and Lazarus/FPC?
Post by: Carver413 on September 19, 2011, 10:22:47 pm
You mean like this
http://dl.dropbox.com/u/17721962/Screenshot.jpg (http://dl.dropbox.com/u/17721962/Screenshot.jpg)
Title: Re: Autocad and Lazarus/FPC?
Post by: Avishai on September 19, 2011, 10:44:15 pm
More like this.
Title: Re: Autocad and Lazarus/FPC?
Post by: Carver413 on September 19, 2011, 11:15:44 pm
Ok yours is cooler then mine,but then again I'm not really creating a cad. it's more like a modern opengl tool kit for gui design. the kind of tool kit you would want to have if you were tring to make a cad. 
Title: Re: Autocad and Lazarus/FPC?
Post by: TurboRascal on September 20, 2011, 10:27:04 am
The solution is simple;
Make an AutoCad clone in Lazarus-FPC :D
That's my philosophy, if nothing suites you, make it your self!

Well, perhaps the solution might be to take LibreCAD+LibreDWG and add FP and all command hooks needet to it which should be easier than in ACAD since it's open source... That might be a great product...
Title: Re: Autocad and Lazarus/FPC?
Post by: BlueIcaro on September 20, 2011, 11:32:42 am
Hello, I think it will a huge project, like Lazarus. I would like work on it.

In other way, I think must be based on OpenGl to render the draws.

It's a very huge project for me. But Thinking on it I love it.

/BlueIcaro
Title: Re: Autocad and Lazarus/FPC?
Post by: Avishai on September 20, 2011, 12:06:25 pm
Quote
take LibreCAD+LibreDWG and add FP
That sounds like fun.  If I could use Lazarus/FPC to develope, I would like to get involved, but it is C++ I think.  But I think LibreCAD is 2D only.
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on November 15, 2011, 10:34:52 am
Quote
The solution is simple;
Make an AutoCad clone in Lazarus-FPC 
That's my philosophy, if nothing suites you, make it your self!
I agree, and am trying to write a "clone" AutoCAD :D
http://shamangrad.net/project.php?act=view&prj=zcad
Title: Re: Autocad and Lazarus/FPC?
Post by: felipemdc on November 15, 2011, 11:25:29 am
I also have an AutoCAD "clone" called turbocircuit:

http://wiki.lazarus.freepascal.org/Turbo_Circuit

It was started as a circuit drawer, but now it is being rewritten as a general vectorial image program which is based on fpvectorial so it supports a plethora of formats =D

It is being renamed to Turbo Circuits and Vectors to represent it's general usage.

Although I must say that ZCad looks way more advanced then what I have. Also I dont plan on supporting 3D, like ever. Although I will add 3D rendering for fpvectorial in the near future.

I want to use Turbo Circuits and Vectors to draw simple diagrams, I dont expect it to get so advanced like ZCad is.
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on November 15, 2011, 02:23:23 pm
ZCAD also started as editor of electrical circuits, but the 3D and "similarity" to AutoCAD were laid down originally. Now I'm trying to distinguish the graphics engine and separate it from the CAD implementation.

ZCAD not advanced - sources in terrible condition, the architecture of the program is not thought
Title: Re: Autocad and Lazarus/FPC?
Post by: JuhaManninen on November 15, 2011, 10:08:42 pm
I agree, and am trying to write a "clone" AutoCAD :D
http://shamangrad.net/project.php?act=view&prj=zcad

Amazing, there are many Lazarus applications I haven't heard of. You could mention it here:
  http://wiki.lazarus.freepascal.org/Projects_using_Lazarus

What is the license? What about making it cross-platform?

Juha
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on November 16, 2011, 05:57:42 am
license - MLGPL (with the exception of several specialized modules for electrical design)
source - http://svn.shamangrad.net/zcad/trunk

The program is cross-platform, I checked the work on windows 32bit and ubuntu 64bit

Quote
You could mention it here:
  http://wiki.lazarus.freepascal.org/Projects_using_Lazarus
ZCAD not yet reached the state so that it can be used as a CAD program. On page http://wiki.lazarus.freepascal.org/Projects_using_Lazarus him too early.
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on February 20, 2012, 08:21:39 pm
ZCAD survived a big update:
+ added binary space partitioning
+ added a mechanism to simplify remote graphics
+ almost everywhere earned undo/redo
- Added a lot of bugs((

Now it is possible open and edit big DXF drawings (with hardware OpenGL)
I added a reference to ZCAD on http://wiki.lazarus.freepascal.org/Projects_using_Lazarus and https://sourceforge.net/projects/zcad
Title: Re: Autocad and Lazarus/FPC?
Post by: CaptBill on February 21, 2012, 12:42:23 am
Hi fellas,

The DXF file standard is fairly simple to implement. It is the defacto standard used with 3-d CAD and is well documented. Been around a long time and is very mature. Probably the best way to approach any CAD project is to embrace the DXF standard (You will need to anyway.ALL serious CAD programs use it or can at least import/export to/from).

http://www.autodesk.com/techpubs/autocad/acadr14/dxf/ascii_dxf_file_format_al_u05_b.htm

There are many Delphi components already available too. Should be able to locate a header file to have all the DXF elements ready to go at Torreys (seems like I have seen it there) to get rolling.

http://www.torry.net/pages.php?id=196

Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on February 21, 2012, 05:04:18 am
dxf r12 - yes, it is easy to read and write. Write DXF r2000 is not so easy, despite the seeming good of documentation.
Most of the components that I have seen, not so good, the appearance is very different in AutoCAD and component, rendering speed is not satisfactory, not free.
Title: Re: Autocad and Lazarus/FPC?
Post by: felipemdc on February 21, 2012, 07:39:02 am
fpvectorial has DXF reading support. Actually fpvectorial is the base for TurboCircuit.
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on February 21, 2012, 05:14:42 pm
Unfortunately fpvectorial does not support BlockDef, BlockInsert, Layers, TextStyles, etc. I started writing ZСAD before the appearance of this component, otherwise would have used it
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on March 19, 2012, 10:09:01 am
felipemdc
It would be nice if in the Lazarus add a small example of loading and displaying the dxf files used fpvectorial
Title: Re: Autocad and Lazarus/FPC?
Post by: felipemdc on March 19, 2012, 03:26:37 pm
Reading a DXF file is just 1 line of code in fpvectorial, as can be seen here:

http://wiki.lazarus.freepascal.org/fpvectorial#Format_conversion

Rendering to a TCanvas is explained here:

http://wiki.lazarus.freepascal.org/fpvectorial#Rendering_the_image_into_a_TCanvas

See also fpvviewer:

http://wiki.lazarus.freepascal.org/fpvectorial#fpvviewer

There is also 3D rendering with OpenGL, that's not for DXF but just thought I'd show because it is cool =)

http://wiki.lazarus.freepascal.org/fpvectorial#fpv3dviewer
Title: Re: Autocad and Lazarus/FPC?
Post by: zamtmn on June 08, 2012, 09:29:33 am
felipemdc
Thank you, reviewed more closely fpvectorial. I'll try to use it to import vector formats to zcad