Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AEC Objects & LISP

27 REPLIES 27
Reply
Message 1 of 28
coffeeTwitch
2212 Views, 27 Replies

AEC Objects & LISP

Anyone know how to get into the AEC objects (Civil 3D & Architecture) with LISP? I am trying to get into the AEC Drawing setup info using vlax functions in lisp. The following doesn't work, but I hope it will illustrate what I am trying to do.
Any help appreciated,
tom


(defun c:getaec ( / acad_app aec_app aec_doc aec_pref temp_lu)

(setq acad_app (vlax-get-acad-object))
(setq aec_app (vlax-invoke-method acad_app 'GetInterfaceObject "AecBase.Application"))
(setq aec_doc (vlax-get-property aec_app 'AecBaseDocument))
(setq aec_pref (vlax-get-property aec_doc 'AecBaseDatabasePreferences))

(setq temp_lu (vlax-get-property aec_pref 'LinearUnit))

(print temp_lu)

)
27 REPLIES 27
Message 21 of 28

What about stand alone development, outside Civil 3D?

Is it possbible to reference C3D dot net libraries in stand alone devlopments?

Or should developers only build applications to worlk inside C3D?

Are the answers consistant with 2012 and 2013 versions of C3D?

Thanks,

Kevin.

 

Message 22 of 28
rubenarias
in reply to: coffeeTwitch

Hi there,

 

I disagree with everyone who thinks LISP is old and a bad way to develop Civil 3D.

 

LISP is cool, clear, and stable, and one can do a lot of things using LISP.

 

The key is to know how to use properties and methods, and just all of then use the same structure :

(vlax-get-Property *Object* 'Property)

(vlax-inoke-method *Object* 'Method)

 

Although to start a Civil 3D application, we need to know some other functions 

 

First of all we activate the Visual Lisp extension for AutoLISP

(vl-load-com) ;;;Enables vl, vla and vlax funtions

 

To catch the Civil 3D application (an objet of AeccAplication class)
(if (not *Civil3D*)                        
   (setq *Civil3D*
      (vla-getinterfaceObject
         (vlax-get-acad-object);;;AutoCAD Object Application (any version)
         "AeccXUiLand.AeccApplication.7.0" ;Civil3D2010 Object Application      
      )      ;;;some other versions:                    
   )         ;;; 2009... "AeccXUiLand.AeccApplication.6.0"                      
)            ;;; 2011... "AeccXUiLand.AeccApplication.8.0"

             ;;; 2012... "AeccXUiLand.AeccApplication.9.0"   

 

From here, we can use properties and methods as if we were using any other language:

For example, to take the ActiveDoument (a AeccApplication Property)
(if (not *aeccDoc*)
  (setq *aeccDoc* (vlax-get-Property *Civil3D* 'ActiveDocument)))

Etc...

Rubén Arias Fernández
PhD. Civil Engineer
Message 23 of 28

Although LISP is good and still working, the COM interfaces used accessible from LISP to customize Civil 3D are not evolving anymore, all new features and improvements are coming to .NET API (which we cannot access from LISP).

 

In general, consider LISP+COM a good way for small or prototype applications, and .NET for bigger and more complex. Also C++ can access both COM and .NET, but it's a more complicated language for beginners.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 24 of 28

Kevin,

 

To access Civil 3D APIs from stand alone application you need COM. You can either use native built-in COM APIs inside Civil 3D or expose .NET features through COM interfaces, see more at http://through-the-interface.typepad.com/through_the_interface/2009/05/interfacing-an-external-com-a...

 

Access from outside have advantages, but in general the COM interface add complexity and, therefore, speed/performance cost. Not much, but should be considered if you application does lots of data interchange with Civil 3D.

 

Yes, it's consistent between 2012 and 2013, but note that binary incompatibility between those two version will force applications that run inside Civil 3D to be rebuild, nothing complicated though, see at http://adndevblog.typepad.com/autocad/2012/04/migrating-objectarx-and-net-plug-ins-to-autocad-2013.h...

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 25 of 28

Glad you are happy, that is all that matters. Yeah I worked in the yard and on the vehicles all weekend. Leland Leahy COUGHLINPORTERLUNDEEN STRUCTURAL CIVIL SEISMIC ENGINEERING 413 Pine Street | Suite 300 | Seattle WA 98101 P: 206.343.0460 | F: 206.343.5691 www.cplinc.com
Leland
Civil3d 2020
Windows 10 64x (32 gigs ram)
Message 26 of 28
kulfi
in reply to: peterfunkautodesk

OK can you tell which or which training i should take to learn API.

thanks

Kulfi
Electronics Engineer

Pind Saudi Arabia



Message 27 of 28
Partha.Sarkar
in reply to: kulfi

Hi Kulfi,

 

I am sure, there would various organizations to deliver a customized API training, however, to get started you can refer to Autodesk DevTVs (these are training videos on API) and you can also refer to other resources available in Autodesk website. See the links below -

 

http://www.youtube.com/channel/UC6Fl_1mFNt0rBqa068Vaxcg

 

http://usa.autodesk.com/adsk/servlet/index?id=1911627&siteID=123112

 

 

Thanks,
Partha Sarkar

 



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 28 of 28
kulfi
in reply to: kbarnettza

 

Thanks a lot for providing vlauable informations,

My Issue here is that i ned to get all the Aecc Objects ( Pressure Pipe Accessories) Information from Civil 3d 2014 (Pressure Network) a new topic added to Civil 3d , My concern here is if there is any related material on this issue which will be really helfull to me.

Thanks

Kulfi
Electronics Engineer

Pind Saudi Arabia



Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report