AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Spot Elevation Extraction using lisp

17 REPLIES 17
Reply
Message 1 of 18
jregier
1891 Views, 17 Replies

Spot Elevation Extraction using lisp

what is the command line equivalent of surface utilities -> lable spot elevation. I need to extract surface elevation point values for a list of 7000 horizontal points. Where can i find a listing of command line equivalents for all map and land functions for lisp usage.
Jim
17 REPLIES 17
Message 2 of 18
Anonymous
in reply to: jregier

This is what it looks like with command echo
on:

(dt_mnl)(zz_sdsk '(dt_spotlabel))

 

I'm pretty sure it can't be called from the command
line.


Bud Miller

href="http://www.BudCAD.com">www.BudCAD.com

Legal Descriptions, Parcel,
Point &
Pline Reports, Layer Reports,
Automated Point Groups and
more.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
what
is the command line equivalent of surface utilities -> lable spot
elevation. I need to extract surface elevation point values for a list of 7000
horizontal points. Where can i find a listing of command line equivalents for
all map and land functions for lisp usage.
Jim
Message 3 of 18
Anonymous
in reply to: jregier

From VBA you can use:

 

RetVal = object.GetElevation(Easting,
Northing)

 

where "object" is the surface.


Bud Miller

href="http://www.BudCAD.com">www.BudCAD.com

Legal Descriptions, Parcel,
Point &
Pline Reports, Layer Reports,
Automated Point Groups and
more.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

This is what it looks like with command echo
on:

(dt_mnl)(zz_sdsk '(dt_spotlabel))

 

I'm pretty sure it can't be called from the
command line.


Bud Miller

href="http://www.BudCAD.com">www.BudCAD.com

Legal Descriptions, Parcel,
Point &
Pline Reports, Layer Reports,
Automated Point Groups and
more.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
what
is the command line equivalent of surface utilities -> lable spot
elevation. I need to extract surface elevation point values for a list of
7000 horizontal points. Where can i find a listing of command line
equivalents for all map and land functions for lisp usage.

Jim
Message 4 of 18
Anonymous
in reply to: jregier

(vlax-invoke-method
cur_surf
"getelevation"
easting
northing)

where cur_surf is the surface object you wish to query

--
*************************************************************
Steltman Software Solutions
Easy to Use, Productivity Tools for autodesk Land Desktop
web http://www.rsteltman.com/
email support@rsteltman.com
Toll Free 1.866.260.2514
Fax: 1.905.945.6549
*************************************************************
"jregier" wrote in message
news:f0cf7e3.-1@WebX.maYIadrTaRb...
> what is the command line equivalent of surface utilities -> lable spot
elevation. I need to extract surface elevation point values for a list of
7000 horizontal points. Where can i find a listing of command line
equivalents for all map and land functions for lisp usage.
> Jim
>
Message 5 of 18
jregier
in reply to: jregier

Thanks Bud,
now i'm getting upset (not at you). why wouldn't there be a command line equivalent as per map functions. I did find that the function (dt_spotlabel) at the command line requests a leader point, but can't incorporate the function into a routine (would be re-entering lisp during execution). Where do I go from here.
Jim
Message 6 of 18
Anonymous
in reply to: jregier

Jim,

The approach to programming with the ALDD objects is different from that
used historically for normal AutoCAD objects.

Bud's code here is the way to go, rather than trying to use an extract of
the menu line (Note in VBA you can use a SendCommand including the
(dt_spotlabel) components to use the ALDD commands)

You do need more code than indicated here though as you will have to define
the surface variable "object"

Have you looked in the sample code supplied with the software ?
--


Laurie Comerford
CADApps
www.cadapps.com.au

"Bud" wrote in message
news:F3BDDBF37F76D643F82E2FF93333A54B@in.WebX.maYIadrTaRb...
> From VBA you can use:
>
> RetVal = object.GetElevation(Easting, Northing)
>
> where "object" is the surface.
>
> Bud Miller
> www.BudCAD.com
> Legal Descriptions, Parcel, Point &
> Pline Reports, Layer Reports,
> Automated Point Groups and more.
>
> "Bud" wrote in message
news:CE65958067D85C4375716A2895481C79@in.WebX.maYIadrTaRb...
> This is what it looks like with command echo on:
> (dt_mnl)(zz_sdsk '(dt_spotlabel))
>
> I'm pretty sure it can't be called from the command line.
>
> Bud Miller
> www.BudCAD.com
> Legal Descriptions, Parcel, Point &
> Pline Reports, Layer Reports,
> Automated Point Groups and more.
>
> "jregier" wrote in message
news:f0cf7e3.-1@WebX.maYIadrTaRb...
> what is the command line equivalent of surface utilities -> lable spot
elevation. I need to extract surface elevation point values for a list of
7000 horizontal points. Where can i find a listing of command line
equivalents for all map and land functions for lisp usage.
> Jim
Message 7 of 18
jregier
in reply to: jregier

Thanks all. Robert, what is the type and format of variable cur-surf, is it the name of the terrain surface, or an entity on the surface. I tried the sub-routine you posted, but it gives a bad-argument type for cur-surf (i tried the name of the surface terrain "EQUI_01_B2" and variations of entity selection).
Jim
Message 8 of 18
Anonymous
in reply to: jregier

As Robert said, cur-surf is the current surface
object. If you are just getting started using the ActiveX interface to LDDT, I
would suggest that you start in VBA. There are some great examples in the help
file, and that help file is tightly integrated with the VBA Editor. After you
get comfortable with working with LDDT object, either re code in LISP, or just
make a LISP wrapper to the VBA function. I realize that you probably don't know
VBA, but I bet that if you start with the examples, you will have more
done by this afternoon in VBA than if you worked all week translating
VBA to VisualLISP. Working with Object is much different than sending commands
via LISP. As such it takes a new programming style.

 

Regards,

 

Peter Funk

API Product Manager

Building Industry Division

Autodesk, Inc.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
all. Robert, what is the type and format of variable cur-surf, is it the name
of the terrain surface, or an entity on the surface. I tried the sub-routine
you posted, but it gives a bad-argument type for cur-surf (i tried the name of
the surface terrain "EQUI_01_B2" and variations of entity selection).

Jim
Message 9 of 18
jregier
in reply to: jregier

Peter
you would bet wrong. while certainly not something commercial, the following routine doe what i need. I wrote and debugged it in less then 20 minutes. The get_elev is not the end result, the function will be dropped into elevation correction routines linked to external databases. I do thank all who have responded, it helped immensly - i have very little time for development, and need to program on the fly.

(defun get_elev ()
(setq e (entlast) d (entget e) elev (cdr (assoc 1 d)))
(command "erase" e "")
(alert (strcat "Elevation is " elev)))

(defun ldd_get_elev ()
(setq pt (getpoint) filenm "c:/acad/temp.scr" fileref (open filenm "w"))
(write-line "(dt_spotlabel)" fileref)
(write-line (strcat (rtos (car pt) 2 2) "," (rtos (cadr pt) 2 2)) fileref)
(write-line " " fileref)
(write-line "(get_elev)" fileref)
(close fileref)
(command "script" "c:/acad/temp.scr"))
Message 10 of 18
Anonymous
in reply to: jregier

If you want to expand into the more
powerful ActiveX interface instead of AutoLISP scripting, then my comment
stands.

 

Regards,

 

Peter Funk

API Product Manager

Building Industry Division

Autodesk, Inc.
Message 11 of 18
jregier
in reply to: jregier

OK, fair enough. But i still would like a (better) LISP function that returns the elevation (or nil if out of bounds) for a point on a surface. Ive loaded the vl com and reactors, and tried the vlisp help. Using Roberts suggestion as a starting point,
>
(vlax-invoke-method
cur_surf
"getelevation"
<
how do i set the cur_surf object - something similar to (setq cur_surf (vlax-get-object ???)).
Jim
Message 12 of 18
Anonymous
in reply to: jregier

OK, Now we're on the same page! You have all the
functionally that you need using the ActiveX interface to the LDDT object model
(including exactly what you are looking for). The help that you are looking for
will not be in the Vlisp help file, it will be in the landauto-reference.chm
file. This help file was written using the VBA syntax, but all the object,
methods and properties are available in Vlisp (once you add a reference to the
type library). If you really want to program in Vlisp, you will have to
translate the examples from VBA to VLisp. For LDDT, the starting point is the
LDDT application object, from there, the current Project, and from the project,
you are off and running. Again, look at the examples in the help file for how it
is done in VBA, and mimic that syntax. However, I really think that you will
make better use of your time if you program in VBA, and then wrap those routines
with LISP calls. Not only will you have a wealth of sample code, the VBA editor
is far better than the VLisp editor. As an added benefit, you will never have to
use DCL again!

 

Regards,

 

Peter Funk

API Product Manager

Building Industry Division

Autodesk, Inc.

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
OK,
fair enough. But i still would like a (better) LISP function that returns the
elevation (or nil if out of bounds) for a point on a surface. Ive loaded the
vl com and reactors, and tried the vlisp help. Using Roberts suggestion as a
starting point,

(vlax-invoke-method
 cur_surf
 "getelevation"
<

how do i set the cur_surf object - something similar to (setq cur_surf
(vlax-get-object ???)).
Jim

Message 13 of 18
Anonymous
in reply to: jregier

(defun set_up_surfs (/)
;;;This will get the first surface defined!
;;;Note there are no error checkers
(princ
"\nCopyright© Robert Steltman Inc.\twww.rsteltman.com\tToll Free
1.866.260.2514\n")
(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq aeccApp (vl-catch-all-apply
'vla-getinterfaceobject
(list acadObj "Aecc.Application")))
(setq aeccProj (vlax-get aeccApp "ActiveProject"))
(setq surfs (vlax-get aeccproj "surfaces"))
(setq cur_surf (vla-item surfs 0)))

--
*************************************************************
Steltman Software Solutions
Easy to Use, Productivity Tools for autodesk Land Desktop
web http://www.rsteltman.com/
email support@rsteltman.com
Toll Free 1.866.260.2514
Fax: 1.905.945.6549
*************************************************************
"Peter Funk - Autodesk, Inc" wrote in message
news:0FB83D508561D0CF1692EE14DBC9C08F@in.WebX.maYIadrTaRb...
> OK, Now we're on the same page! You have all the functionally that you
need using the ActiveX interface to the LDDT object model (including exactly
what you are looking for). The help that you are looking for will not be in
the Vlisp help file, it will be in the landauto-reference.chm file. This
help file was written using the VBA syntax, but all the object, methods and
properties are available in Vlisp (once you add a reference to the type
library). If you really want to program in Vlisp, you will have to translate
the examples from VBA to VLisp. For LDDT, the starting point is the LDDT
application object, from there, the current Project, and from the project,
you are off and running. Again, look at the examples in the help file for
how it is done in VBA, and mimic that syntax. However, I really think that
you will make better use of your time if you program in VBA, and then wrap
those routines with LISP calls. Not only will you have a wealth of sample
code, the VBA editor is far better than the VLisp editor. As an added
benefit, you will never have to use DCL again!
>
> Regards,
>
> Peter Funk
> API Product Manager
> Building Industry Division
> Autodesk, Inc.
>
>
> "jregier" wrote in message
news:f0cf7e3.9@WebX.maYIadrTaRb...
> OK, fair enough. But i still would like a (better) LISP function that
returns the elevation (or nil if out of bounds) for a point on a surface.
Ive loaded the vl com and reactors, and tried the vlisp help. Using Roberts
suggestion as a starting point,
> (vlax-invoke-method
> cur_surf
> "getelevation"
> <
> how do i set the cur_surf object - something similar to (setq cur_surf
(vlax-get-object ???)).
> Jim
>
>
Message 14 of 18
Anonymous
in reply to: jregier

Hi Robert,

A VBA equivalent is:

Function GetElev (dVar1 as double, dVar2 as double, sVar as string )
Dim oDTM as AeccSurface ' o for object
Dim dElev as Double
Set ogDTM = AeccApplication.ActiveProject.Surfaces.Item (sVar)
dElev = ogDTM.GetElevation (dVar1, dVar2)
GetElev = dElev ' Return the data to the calling function
End Function

Sub AnyOldCode ()
Dim sDTM as String ' s for string
Dim dEast as Double ' d for double
Dim dNorth as Double
dim dElev as Double
... Other code which will probably establish values for the variables below
sDTM = "Surface1" ' Can be any surface name
dEast = 1000 ' Can be any coordinate
dNorth = 1000 ' Can be any coordinate
dElev = GetElev (dEast, dNorth, sDTM) ' Call the function to get the
value
.... any other code
End Sub


This could be simplified by not using variables to get the data, but in a
real program East, North and sDTM etc would be held in variables:

dElev = AeccApplication.ActiveProject.Surfaces.Item
("Surface1").GetElevation (1000,1000)

It may be habit, but I find the VBA code easier to follow.
As Peter mentioned the sample code for VBA is far more extensive than for
Lisp.

--


Laurie Comerford
CADApps
www.cadapps.com.au


"Robert Steltman" wrote in message
news:7658CF2408FA41638AAFFEDE46D7D346@in.WebX.maYIadrTaRb...
> (defun set_up_surfs (/)
> ;;;This will get the first surface defined!
> ;;;Note there are no error checkers
> (princ
> "\nCopyright© Robert Steltman Inc.\twww.rsteltman.com\tToll Free
> 1.866.260.2514\n")
> (vl-load-com)
> (setq acadObj (vlax-get-acad-object))
> (setq aeccApp (vl-catch-all-apply
> 'vla-getinterfaceobject
> (list acadObj "Aecc.Application")))
> (setq aeccProj (vlax-get aeccApp "ActiveProject"))
> (setq surfs (vlax-get aeccproj "surfaces"))
> (setq cur_surf (vla-item surfs 0)))
>
> --
> *************************************************************
> Steltman Software Solutions
> Easy to Use, Productivity Tools for autodesk Land Desktop
> web http://www.rsteltman.com/
> email support@rsteltman.com
> Toll Free 1.866.260.2514
> Fax: 1.905.945.6549
> *************************************************************
> "Peter Funk - Autodesk, Inc" wrote in message
> news:0FB83D508561D0CF1692EE14DBC9C08F@in.WebX.maYIadrTaRb...
> > OK, Now we're on the same page! You have all the functionally that you
> need using the ActiveX interface to the LDDT object model (including
exactly
> what you are looking for). The help that you are looking for will not be
in
> the Vlisp help file, it will be in the landauto-reference.chm file. This
> help file was written using the VBA syntax, but all the object, methods
and
> properties are available in Vlisp (once you add a reference to the type
> library). If you really want to program in Vlisp, you will have to
translate
> the examples from VBA to VLisp. For LDDT, the starting point is the LDDT
> application object, from there, the current Project, and from the project,
> you are off and running. Again, look at the examples in the help file for
> how it is done in VBA, and mimic that syntax. However, I really think that
> you will make better use of your time if you program in VBA, and then wrap
> those routines with LISP calls. Not only will you have a wealth of sample
> code, the VBA editor is far better than the VLisp editor. As an added
> benefit, you will never have to use DCL again!
> >
> > Regards,
> >
> > Peter Funk
> > API Product Manager
> > Building Industry Division
> > Autodesk, Inc.
> >
> >
> > "jregier" wrote in message
> news:f0cf7e3.9@WebX.maYIadrTaRb...
> > OK, fair enough. But i still would like a (better) LISP function that
> returns the elevation (or nil if out of bounds) for a point on a surface.
> Ive loaded the vl com and reactors, and tried the vlisp help. Using
Roberts
> suggestion as a starting point,
> > (vlax-invoke-method
> > cur_surf
> > "getelevation"
> > <
> > how do i set the cur_surf object - something similar to (setq cur_surf
> (vlax-get-object ???)).
> > Jim
> >
> >
>
>
Message 15 of 18
Anonymous
in reply to: jregier

220, 221... whatever it takes.

--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juhden@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711


"Laurie Comerford" wrote in message news:D23FE6436B15A42A05FBE78484AA58ED@in.WebX.maYIadrTaRb...
> Hi Robert,
>
> A VBA equivalent is:
>
> Function GetElev (dVar1 as double, dVar2 as double, sVar as string )
> Dim oDTM as AeccSurface ' o for object
> Dim dElev as Double
> Set ogDTM = AeccApplication.ActiveProject.Surfaces.Item (sVar)
> dElev = ogDTM.GetElevation (dVar1, dVar2)
> GetElev = dElev ' Return the data to the calling function
> End Function
>
> Sub AnyOldCode ()
> Dim sDTM as String ' s for string
> Dim dEast as Double ' d for double
> Dim dNorth as Double
> dim dElev as Double
> ... Other code which will probably establish values for the variables below
> sDTM = "Surface1" ' Can be any surface name
> dEast = 1000 ' Can be any coordinate
> dNorth = 1000 ' Can be any coordinate
> dElev = GetElev (dEast, dNorth, sDTM) ' Call the function to get the
> value
> .... any other code
> End Sub
>
>
> This could be simplified by not using variables to get the data, but in a
> real program East, North and sDTM etc would be held in variables:
>
> dElev = AeccApplication.ActiveProject.Surfaces.Item
> ("Surface1").GetElevation (1000,1000)
>
> It may be habit, but I find the VBA code easier to follow.
> As Peter mentioned the sample code for VBA is far more extensive than for
> Lisp.
>
> --
>
>
> Laurie Comerford
> CADApps
> www.cadapps.com.au
>
>
> "Robert Steltman" wrote in message
> news:7658CF2408FA41638AAFFEDE46D7D346@in.WebX.maYIadrTaRb...
> > (defun set_up_surfs (/)
> > ;;;This will get the first surface defined!
> > ;;;Note there are no error checkers
> > (princ
> > "\nCopyright© Robert Steltman Inc.\twww.rsteltman.com\tToll Free
> > 1.866.260.2514\n")
> > (vl-load-com)
> > (setq acadObj (vlax-get-acad-object))
> > (setq aeccApp (vl-catch-all-apply
> > 'vla-getinterfaceobject
> > (list acadObj "Aecc.Application")))
> > (setq aeccProj (vlax-get aeccApp "ActiveProject"))
> > (setq surfs (vlax-get aeccproj "surfaces"))
> > (setq cur_surf (vla-item surfs 0)))
> >
> > --
> > *************************************************************
> > Steltman Software Solutions
> > Easy to Use, Productivity Tools for autodesk Land Desktop
> > web http://www.rsteltman.com/
> > email support@rsteltman.com
> > Toll Free 1.866.260.2514
> > Fax: 1.905.945.6549
> > *************************************************************
> > "Peter Funk - Autodesk, Inc" wrote in message
> > news:0FB83D508561D0CF1692EE14DBC9C08F@in.WebX.maYIadrTaRb...
> > > OK, Now we're on the same page! You have all the functionally that you
> > need using the ActiveX interface to the LDDT object model (including
> exactly
> > what you are looking for). The help that you are looking for will not be
> in
> > the Vlisp help file, it will be in the landauto-reference.chm file. This
> > help file was written using the VBA syntax, but all the object, methods
> and
> > properties are available in Vlisp (once you add a reference to the type
> > library). If you really want to program in Vlisp, you will have to
> translate
> > the examples from VBA to VLisp. For LDDT, the starting point is the LDDT
> > application object, from there, the current Project, and from the project,
> > you are off and running. Again, look at the examples in the help file for
> > how it is done in VBA, and mimic that syntax. However, I really think that
> > you will make better use of your time if you program in VBA, and then wrap
> > those routines with LISP calls. Not only will you have a wealth of sample
> > code, the VBA editor is far better than the VLisp editor. As an added
> > benefit, you will never have to use DCL again!
> > >
> > > Regards,
> > >
> > > Peter Funk
> > > API Product Manager
> > > Building Industry Division
> > > Autodesk, Inc.
> > >
> > >
> > > "jregier" wrote in message
> > news:f0cf7e3.9@WebX.maYIadrTaRb...
> > > OK, fair enough. But i still would like a (better) LISP function that
> > returns the elevation (or nil if out of bounds) for a point on a surface.
> > Ive loaded the vl com and reactors, and tried the vlisp help. Using
> Roberts
> > suggestion as a starting point,
> > > (vlax-invoke-method
> > > cur_surf
> > > "getelevation"
> > > <
> > > how do i set the cur_surf object - something similar to (setq cur_surf
> > (vlax-get-object ???)).
> > > Jim
> > >
> > >
> >
> >
>
>
Message 16 of 18
Anonymous
in reply to: jregier

> 220, 221... whatever it takes.

Mr. Mom, right? We quote that line all the time.

"Gotta keep that sense of humor, it's critical."

Bud Miller

"John Uhden" wrote in message
news:AF86836B704CC6E93930028B643E964B@in.WebX.maYIadrTaRb...
> 220, 221... whatever it takes.
>
> --
> John Uhden, Cadlantic/formerly CADvantage
> [ mailto:juhden@cadlantic.com ]
> [ http://www.cadlantic.com ]
> 2 Village Road
> Sea Girt, NJ 08750
> Tel. 732-974-1711
>
>
> "Laurie Comerford" wrote in message
news:D23FE6436B15A42A05FBE78484AA58ED@in.WebX.maYIadrTaRb...
> > Hi Robert,
> >
> > A VBA equivalent is:
> >
> > Function GetElev (dVar1 as double, dVar2 as double, sVar as string )
> > Dim oDTM as AeccSurface ' o for object
> > Dim dElev as Double
> > Set ogDTM = AeccApplication.ActiveProject.Surfaces.Item (sVar)
> > dElev = ogDTM.GetElevation (dVar1, dVar2)
> > GetElev = dElev ' Return the data to the calling function
> > End Function
> >
> > Sub AnyOldCode ()
> > Dim sDTM as String ' s for string
> > Dim dEast as Double ' d for double
> > Dim dNorth as Double
> > dim dElev as Double
> > ... Other code which will probably establish values for the variables
below
> > sDTM = "Surface1" ' Can be any surface name
> > dEast = 1000 ' Can be any coordinate
> > dNorth = 1000 ' Can be any coordinate
> > dElev = GetElev (dEast, dNorth, sDTM) ' Call the function to get
the
> > value
> > .... any other code
> > End Sub
> >
> >
> > This could be simplified by not using variables to get the data, but in
a
> > real program East, North and sDTM etc would be held in variables:
> >
> > dElev = AeccApplication.ActiveProject.Surfaces.Item
> > ("Surface1").GetElevation (1000,1000)
> >
> > It may be habit, but I find the VBA code easier to follow.
> > As Peter mentioned the sample code for VBA is far more extensive than
for
> > Lisp.
> >
> > --
> >
> >
> > Laurie Comerford
> > CADApps
> > www.cadapps.com.au
> >
> >
> > "Robert Steltman" wrote in message
> > news:7658CF2408FA41638AAFFEDE46D7D346@in.WebX.maYIadrTaRb...
> > > (defun set_up_surfs (/)
> > > ;;;This will get the first surface defined!
> > > ;;;Note there are no error checkers
> > > (princ
> > > "\nCopyright© Robert Steltman Inc.\twww.rsteltman.com\tToll Free
> > > 1.866.260.2514\n")
> > > (vl-load-com)
> > > (setq acadObj (vlax-get-acad-object))
> > > (setq aeccApp (vl-catch-all-apply
> > > 'vla-getinterfaceobject
> > > (list acadObj "Aecc.Application")))
> > > (setq aeccProj (vlax-get aeccApp "ActiveProject"))
> > > (setq surfs (vlax-get aeccproj "surfaces"))
> > > (setq cur_surf (vla-item surfs 0)))
> > >
> > > --
> > > *************************************************************
> > > Steltman Software Solutions
> > > Easy to Use, Productivity Tools for autodesk Land Desktop
> > > web http://www.rsteltman.com/
> > > email support@rsteltman.com
> > > Toll Free 1.866.260.2514
> > > Fax: 1.905.945.6549
> > > *************************************************************
> > > "Peter Funk - Autodesk, Inc" wrote in
message
> > > news:0FB83D508561D0CF1692EE14DBC9C08F@in.WebX.maYIadrTaRb...
> > > > OK, Now we're on the same page! You have all the functionally that
you
> > > need using the ActiveX interface to the LDDT object model (including
> > exactly
> > > what you are looking for). The help that you are looking for will not
be
> > in
> > > the Vlisp help file, it will be in the landauto-reference.chm file.
This
> > > help file was written using the VBA syntax, but all the object,
methods
> > and
> > > properties are available in Vlisp (once you add a reference to the
type
> > > library). If you really want to program in Vlisp, you will have to
> > translate
> > > the examples from VBA to VLisp. For LDDT, the starting point is the
LDDT
> > > application object, from there, the current Project, and from the
project,
> > > you are off and running. Again, look at the examples in the help file
for
> > > how it is done in VBA, and mimic that syntax. However, I really think
that
> > > you will make better use of your time if you program in VBA, and then
wrap
> > > those routines with LISP calls. Not only will you have a wealth of
sample
> > > code, the VBA editor is far better than the VLisp editor. As an added
> > > benefit, you will never have to use DCL again!
> > > >
> > > > Regards,
> > > >
> > > > Peter Funk
> > > > API Product Manager
> > > > Building Industry Division
> > > > Autodesk, Inc.
> > > >
> > > >
> > > > "jregier" wrote in message
> > > news:f0cf7e3.9@WebX.maYIadrTaRb...
> > > > OK, fair enough. But i still would like a (better) LISP function
that
> > > returns the elevation (or nil if out of bounds) for a point on a
surface.
> > > Ive loaded the vl com and reactors, and tried the vlisp help. Using
> > Roberts
> > > suggestion as a starting point,
> > > > (vlax-invoke-method
> > > > cur_surf
> > > > "getelevation"
> > > > <
> > > > how do i set the cur_surf object - something similar to (setq
cur_surf
> > > (vlax-get-object ???)).
> > > > Jim
> > > >
> > > >
> > >
> > >
> >
> >
Message 17 of 18
Anonymous
in reply to: jregier

Zactly.

My recent favorite is telling the client they have an "ID Ten T" error... "ID10T"

--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juhden@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711


"Bud Miller" wrote in message news:09A9F3CAF567E5CF5399F1C065A0FDF7@in.WebX.maYIadrTaRb...
> > 220, 221... whatever it takes.
>
> Mr. Mom, right? We quote that line all the time.
>
> "Gotta keep that sense of humor, it's critical."
>
> Bud Miller
>
> "John Uhden" wrote in message
> news:AF86836B704CC6E93930028B643E964B@in.WebX.maYIadrTaRb...
> > 220, 221... whatever it takes.
> >
> > --
> > John Uhden, Cadlantic/formerly CADvantage
> > [ mailto:juhden@cadlantic.com ]
> > [ http://www.cadlantic.com ]
> > 2 Village Road
> > Sea Girt, NJ 08750
> > Tel. 732-974-1711
> >
> >
> > "Laurie Comerford" wrote in message
> news:D23FE6436B15A42A05FBE78484AA58ED@in.WebX.maYIadrTaRb...
> > > Hi Robert,
> > >
> > > A VBA equivalent is:
> > >
> > > Function GetElev (dVar1 as double, dVar2 as double, sVar as string )
> > > Dim oDTM as AeccSurface ' o for object
> > > Dim dElev as Double
> > > Set ogDTM = AeccApplication.ActiveProject.Surfaces.Item (sVar)
> > > dElev = ogDTM.GetElevation (dVar1, dVar2)
> > > GetElev = dElev ' Return the data to the calling function
> > > End Function
> > >
> > > Sub AnyOldCode ()
> > > Dim sDTM as String ' s for string
> > > Dim dEast as Double ' d for double
> > > Dim dNorth as Double
> > > dim dElev as Double
> > > ... Other code which will probably establish values for the variables
> below
> > > sDTM = "Surface1" ' Can be any surface name
> > > dEast = 1000 ' Can be any coordinate
> > > dNorth = 1000 ' Can be any coordinate
> > > dElev = GetElev (dEast, dNorth, sDTM) ' Call the function to get
> the
> > > value
> > > .... any other code
> > > End Sub
> > >
> > >
> > > This could be simplified by not using variables to get the data, but in
> a
> > > real program East, North and sDTM etc would be held in variables:
> > >
> > > dElev = AeccApplication.ActiveProject.Surfaces.Item
> > > ("Surface1").GetElevation (1000,1000)
> > >
> > > It may be habit, but I find the VBA code easier to follow.
> > > As Peter mentioned the sample code for VBA is far more extensive than
> for
> > > Lisp.
> > >
> > > --
> > >
> > >
> > > Laurie Comerford
> > > CADApps
> > > www.cadapps.com.au
> > >
> > >
> > > "Robert Steltman" wrote in message
> > > news:7658CF2408FA41638AAFFEDE46D7D346@in.WebX.maYIadrTaRb...
> > > > (defun set_up_surfs (/)
> > > > ;;;This will get the first surface defined!
> > > > ;;;Note there are no error checkers
> > > > (princ
> > > > "\nCopyright© Robert Steltman Inc.\twww.rsteltman.com\tToll Free
> > > > 1.866.260.2514\n")
> > > > (vl-load-com)
> > > > (setq acadObj (vlax-get-acad-object))
> > > > (setq aeccApp (vl-catch-all-apply
> > > > 'vla-getinterfaceobject
> > > > (list acadObj "Aecc.Application")))
> > > > (setq aeccProj (vlax-get aeccApp "ActiveProject"))
> > > > (setq surfs (vlax-get aeccproj "surfaces"))
> > > > (setq cur_surf (vla-item surfs 0)))
> > > >
> > > > --
> > > > *************************************************************
> > > > Steltman Software Solutions
> > > > Easy to Use, Productivity Tools for autodesk Land Desktop
> > > > web http://www.rsteltman.com/
> > > > email support@rsteltman.com
> > > > Toll Free 1.866.260.2514
> > > > Fax: 1.905.945.6549
> > > > *************************************************************
> > > > "Peter Funk - Autodesk, Inc" wrote in
> message
> > > > news:0FB83D508561D0CF1692EE14DBC9C08F@in.WebX.maYIadrTaRb...
> > > > > OK, Now we're on the same page! You have all the functionally that
> you
> > > > need using the ActiveX interface to the LDDT object model (including
> > > exactly
> > > > what you are looking for). The help that you are looking for will not
> be
> > > in
> > > > the Vlisp help file, it will be in the landauto-reference.chm file.
> This
> > > > help file was written using the VBA syntax, but all the object,
> methods
> > > and
> > > > properties are available in Vlisp (once you add a reference to the
> type
> > > > library). If you really want to program in Vlisp, you will have to
> > > translate
> > > > the examples from VBA to VLisp. For LDDT, the starting point is the
> LDDT
> > > > application object, from there, the current Project, and from the
> project,
> > > > you are off and running. Again, look at the examples in the help file
> for
> > > > how it is done in VBA, and mimic that syntax. However, I really think
> that
> > > > you will make better use of your time if you program in VBA, and then
> wrap
> > > > those routines with LISP calls. Not only will you have a wealth of
> sample
> > > > code, the VBA editor is far better than the VLisp editor. As an added
> > > > benefit, you will never have to use DCL again!
> > > > >
> > > > > Regards,
> > > > >
> > > > > Peter Funk
> > > > > API Product Manager
> > > > > Building Industry Division
> > > > > Autodesk, Inc.
> > > > >
> > > > >
> > > > > "jregier" wrote in message
> > > > news:f0cf7e3.9@WebX.maYIadrTaRb...
> > > > > OK, fair enough. But i still would like a (better) LISP function
> that
> > > > returns the elevation (or nil if out of bounds) for a point on a
> surface.
> > > > Ive loaded the vl com and reactors, and tried the vlisp help. Using
> > > Roberts
> > > > suggestion as a starting point,
> > > > > (vlax-invoke-method
> > > > > cur_surf
> > > > > "getelevation"
> > > > > <
> > > > > how do i set the cur_surf object - something similar to (setq
> cur_surf
> > > > (vlax-get-object ???)).
> > > > > Jim
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
>
>
Message 18 of 18
jregier
in reply to: jregier

With help, developed a function to extract an elevation from a surface (or selected surfaces from a list).  It's worked fine until C3D2012 and now with the change in format I need to get it working again.

 

I'm getting error: "Civil 3D API: Triangle is deleted" for points outside the extent of the surface in my sub-function

(setq n

   (vlax-invoke cur_surf 'FindElevationAtXY (car pt) (cadr pt))   )

 

It used to simply return nil without crashing and I could handle the nil value in a number of ways and continue to the next point.  I use the function in a number of routines attached directly to Access databases for modelling grids and correcting elevations of fields in a number of large database sets.

 

Any advice on working around or other vlax function needed to check the xy coordinate to the surface is much appreciated.

 

 

 

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

Post to forums  

Autodesk Design & Make Report