ade_* functions are not exposed in the .NET API. We can work around this by defining a LISP command and calling ade_* function in it and then in .NET application invoke the command defined in LISP. See the bellow codes.
(defun
c:LispADE ()
(setq cscode (ade_projgetwscode))
(if (= cscode null)
(progn
(alert "Error in getting current coordinate system!")
(exit)
)
)
(setq rt (ade_projsetsrc "LL84"))
(if (/= rt t)
(progn
(alert "Error in getting current coordinate system!")
(exit)
)
)
(setq rt1 (ade_projsetdest cscode))
(if (/= rt1 t)
(progn
(alert "Error in setting destination coordinate system!")
(exit)
)
)
(setq entdata (car (entsel "select entity:")))
(setq rt2 (ade_projentityforward entdata))
(if (/= rt2 t)
(progn
(alert
"Error in projecting entity to destination coordinate system!"
)
(exit)
)
(alert "ok")
)
)
The .NET invoking code is here:
[CommandMethod("MyADE")]
public void InvokeAdeFun()
{
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("LispADE", false, true, false);
}
Hope this is useful to you!