VB.NET or C# are the two languages that should be used to work with Civil 3D. While the COM model is still there, it is missing many of the new features that we have added to Civil 3D, is 5 to 10 times slower than the .NET API and may be dropped when the .NET API is competed.
Using LISP takes the slow COM model and attaches it to the impossible syntax of LISP (yes I know LISP and I've written more commerical LISP than most people around) giving you the worst of both worlds.
I strongly suggest stop all LISP development (that means you too Dave G) and move to .NET. The "Express Editions" from Microsoft are free and should provide all the tools that you need.
Me too... I have waited that from Civil 3D 2008 version..
LISP is the best language for testing COM based features quickly upon multiple Civil 3D versions.
No need to add references to Visual Studio 20xx.
(defun c:getaec_example (/ acad_app aec_app aec_doc aec_pref temp_lu)
(setq prodStr (strcat
(setq *acad* (vlax-get-acad-object))
(vla-getinterfaceobject *acad* prodStr)
(setq AECpref (vlax-get-property
(vlax-get-property AECpref 'LinearUnit)
did not proof it for all versions. just for 2012.
I have started to learn .NET mainly to work with the rest of the world and outside of Autocad.
But it makes me wonder why Autodesk would add all the Visual Lisp functions to work with object models, then tell users not to use it. I personally am/was looking for ways that VLisp could read civil3d info from objects, like structures, not create them. Mainly to allow existing programs written in Lisp and working just fine be able to interact with the new objects. But by reading threads on here no matter what anyone asks or posts, Autodesk will continue to tell you to learn .NET.
The interface that you are using in LISP is the COM API that was typically used with VBA. The COM API was designed to be easy to use compared to the C++ ObjectARX API. When it was developed it was known that by making it easy to use it gave up speed (in some cases it is 10 times slower than ObjectARX).
The direction of API has changed to .NET that is eaiser to use than ObjectARX but has almost the same speed (within 5%). With this change we have stopped all active development of the COM API and put all our effort behind the .NET API.
So I'm going to continue to say "don't use Visual LISP" for the following reasons:
1. It is slow
2. It is undocumented
3. It is untested
4. It is hard to use because ((it is LISP)(it uses a wrapper that allows LISP access to the VBA API))
5. It is missing all new object development (the new pressure pipes will not be exposed to COM)
6. It may go away in the future
7. It is very limited compared to .NET
I agree that we should use now and in the future .NET to develope Civil 3D applications.
I really have to give my opinion on those facts what you pointed out.
1. Lisp is slow -> thats OK
2. Lisp or ActiveX is not undocumented but there are not any lisp examples.
3. It´s as bullet proof as ActiveX can be.
4. Lisp code is hard to follow because of syntax. ActiveX interfaces are easy to use but hard to find the problem when it occurs.
5. Because Autodesk have desided to do so. It´s also easier to support one or two APIs only.
6. Or may be not. Of course in Civil 3D world Lisp is out of date.
7. All languages have their limitations even .NET but how to choose right tool to do the job. In small tasks Lisp is better because you don´t have to care about .NET references or servicepacks like .NET have to. In medium and larger Civil 3D projects it´s better to use .NET and ObjectARX languages together. There are now and in the future several ObjectARX functions which are not exposed to .NET. Example in Civil 3D Customdraw API is supported only with ObjectARX.
Unless I'm just making a macro function that runs a command, I don't use LISP. If I'm doing anything else, I use .NET.
While the .NET API isn't complete and there are still a few things that you can only do with COM you can add those into the .NET applications. On the flip side, there are features (superelevation) that you can only get in .NET that have no COM API.
I wouldn't use the Custom Draw API, I would look at the Overrule API that is part of .NET because it is more powerful and can do more than just changing the graphics.
For #6, LISP was designed to work with DXF codes. That is where is was the most powerful. In an object world, it is the wrong tool.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register