Author Topic: How to start Lisp with Civil 3D-Props?  (Read 397 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Bull Frog
  • Posts: 435
How to start Lisp with Civil 3D-Props?
« on: March 17, 2017, 08:05:27 am »
I would like to start with usage of Autolisp in Civil 3D (objects, props, ..)

Are there some references which describes the (different?) ways of communication between Lisp and Civil?

Have a fine weekend?
Peter

AutoCAD 2016 - 2018 German (so some technical terms will be badly retranslated to English)
Civil 3D 2017 - 2018

Jeff_M

  • King Gator
  • Posts: 3891
  • C3D user & customizer
Re: How to start Lisp with Civil 3D-Props?
« Reply #1 on: March 17, 2017, 09:35:23 am »
Peter, no, there are no references specifically for lisp with C3D. If you search the Autodesk C3D Customization forum you will find a number of posts steering you away from lisp lisp to the .NET API. You will also find quite a few small lisp commands that I, and others, have posted. The C3D COM API reference has not been updated since C3D 2012, and some of the links in that are broken so some creative editing of the url is needed at times.

There are quite a few of the COM objects that you cannot get/set properties for due to lisp not recognizing the type of variable it expects. However, there is still a lot you can do in lisp. Here is what I currently use (posted by another user on the C3D forum, I do not recall who that was though) to get the AeccLandApplication for any version of C3D (you will need this to get any C3D object without using a selection):
Code - Auto/Visual Lisp: [Select]
  1. (defun getaeccApp (/ *acad* C3D)
  2.   (setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
  3.     (if vlax-user-product-key
  4.       (vlax-user-product-key)
  5.       (vlax-product-key)
  6.     )
  7.     )
  8. C3D (vl-registry-read C3D "Release")
  9. C3D (substr
  10.       C3D
  11.       1
  12.       (vl-string-search
  13. "."
  14. C3D
  15. (+ (vl-string-search "." C3D) 1)
  16.       )
  17.     )
  18.       (strcat "AeccXUiLand.AeccApplication." C3D)
  19.     )
  20.   )
  21.      )
  22.    C3D
  23.  )
  24. )
  25.  

Peter2

  • Bull Frog
  • Posts: 435
Re: How to start Lisp with Civil 3D-Props?
« Reply #2 on: March 20, 2017, 08:16:15 am »
Thanks Jeff, I will look at it.
Peter

AutoCAD 2016 - 2018 German (so some technical terms will be badly retranslated to English)
Civil 3D 2017 - 2018

BIGAL

  • Newt
  • Posts: 67
  • 30 + years of using Autocad
Re: How to start Lisp with Civil 3D-Props?
« Reply #3 on: March 23, 2017, 09:49:50 pm »
What are you trying to do ?

To give a couple of my examples.
Rotate multiple Aeccpoints
Contour style display via a toolbar rather than toolspace
Label styles via a toolbar
A man who never made a mistake never made anything

Peter2

  • Bull Frog
  • Posts: 435
Re: How to start Lisp with Civil 3D-Props?
« Reply #4 on: March 24, 2017, 04:09:46 am »
Thanks.

In the meantime I found this document:
http://images.autodesk.com/adsk/files/AutoCAD_Civil_3D_API_Developer_s_Guide.pdf

I will start to work with it to understand the basic and the "data-system". For further questions I will come back to the forum.

EDIT: More links
Snoop Civil 3D 2015 Database (.bundle format)
http://adndevblog.typepad.com/infrastructure/2014/04/snoop-civil-3d-2015-database-bundle-format-1.html

Version 2017:
https://github.com/ADN-DevTech/Civil3DSnoop/tree/2017




Civil 3D 2017 - API Developer's Guide:
http://help.autodesk.com/view/CIV3D/2017/ENU/?guid=GUID-DA303320-B66D-4F4F-A4F4-9FBBEC0754E0

xx
« Last Edit: March 28, 2017, 03:26:12 am by Peter2 »
Peter

AutoCAD 2016 - 2018 German (so some technical terms will be badly retranslated to English)
Civil 3D 2017 - 2018