AutoLISP Code : 3Dpoint->2D point

;;; Function: 3dPoint->2dPoint ;
;;;--------------------------------------------------------------------;
;;; Description: This function takes one parameter representing a ;
;;; 3D point (a list of three integers or reals), and ;
;;; converts it into a 2D point (a list of two reals). ;
;;; There is no error checking done on the 3dpt ;
;;; parameter -- it is always expected to be a valid ;
;;; point. ;
;;;--------------------------------------------------------------------;
;;; Work to do: Add some kind of parameter checking so that this ;
;;; function won't crash a program if it is passed a ;
;;; null value, or some other kind of data type than a ;
;;; 3D point. ;
;;;--------------------------------------------------------------------;
(defun 3dPoint->2dPoint (3dpt)
(list (float (car 3dpt)) (float (cadr 3dpt)))
) ;_ end of defun

AutoLISP Code : object->Layer

;;; Function: objet->layer ;
;;;--------------------------------------------------------------------;
;;; Description: This function takes an object and forward ;
;;; it to the choosen layer. ;
;;;
;
;;;------------------------------------------------------------------- ;

(defun objet->layer (Layername / list)
(setq list (entget (entlast)))
(setq list (subst (cons 8 Layername) (assoc 8 list) list))
(entmod list)

)

Useful links for VBA and AutoLISP codes

In this section, I give you my best websites for improving your knowledge on VBA (in excel, or in AutoCAD), or finding various information (with .pdf support or code downloading).Some of them are exclusively in french.
I'll update this content, each time I find a relevant site to advice, so don't hesitate to come around.

'-------------- French Section -----------------------
(Support pdf : yes)

(Code downloading : yes)

'-------------- English Section -----------------------

Open AutoCAD from excel with Visual Basic macro

Description :
This code below gives the way to open a new drawing AutoCAD or to get access to an opened one.
In the next messages, I'll give a better view of the possibilities of this macro
This macro was initially written for AutoCAD 2008 but you can adapt it for any other versions.

Don't forget :
References for your AutoCAD library in Visual basic editor is essential for success.
'--------------------------------------------------
Sub openautocad ()

'to add and upload autocad 2008 references (17= AutoCAD 2008; 18= AutoCAD 2010)
On Error Resume Next
With ThisWorkbook.VBProject.References
Application.DisplayAlerts = False
.AddFromFile "C:\Program Files\Common Files\Autodesk Shared\acax17en.tlb"
End With
Application.DisplayAlerts = True
On Error GoTo 0

'to declare autocad application variable
Dim AcadApp As AcadApplication

On Error Resume Next

Set AcadApp = GetObject(, "AutoCAD.Application.17")
If Err Then
Err.Clear
Set AcadApp = CreateObject("AutoCAD.Application.17")
End If

MsgBox "Now running! : " + AcadApp.Name + " version :" + AcadApp.Version

Set AcadDoc = AcadApp.Application.ActiveDocument

AcadDoc.Regen acActiveViewport
ZoomAll
AcadApp.Application.Visible = True

End Sub