Matt W,
Yes I'm going to use your
varStart = ThisDrawing.Utility.GetPoint(, "Pick start point...")
If Err.Number <> 0 Then
oExcel.Visible = True
Exit Do
Else
varEnd = ThisDrawing.Utility.GetPoint(varStart, "Pick end
point...")
intDistance = Distance(varStart, varEnd)
PopulateExcel
Then pass to x,y data to land to get station offset.
Only issue is going to be connecting to an open excel file rather creating a
new, I might only need to be update some rows in the excel file at a time.
Basically it's a summary file where you what to pick start and end
locations for lets say for curbing. user pick start and end locations for
each run of curbing.
well between the preliminary run of this file and the final product there
might be all kinds of changes but there also might only have a few minor
edits to the file.
That's is why I was looking for a method of click in the excel file and have
AutoCAD know where that is so when I execute those pick points start and end
from your sample the data will be placed in the correct row & cell
Land sta-offset stuff
objAlign.StationOffset varDataPnt(0), varDataPnt(1), dblSta, dblOff, dblDir
strStaFormat = "#0.00"
strOffFormat = "#0.00"
strSta = Left(Format(dblSta, strStaFormat), Len(Format(dblSta,
strStaFormat)) - 5) _
& "+" & Right(Format(dblSta, strStaFormat), 5)
If dblOff > 0 Then
strOff = Format(dblOff, strOffFormat) & "' RT"
Else
strOff = Right(Format(dblOff, strOffFormat), (Len(Format(dblOff,
strOffFormat)) - 1)) _
& "' LT"
End If
strText = "STA: " & (strSta) & "\P" _
& "OFF: " & (strOff) & "\P" _
Set mtxtLabel = ThisDrawing.ModelSpace.AddMText(varDataPnt, dblWidth,
strText)
mtxtLabel.Height = dblHeight
mtxtLabel.Rotation = dblRot
Print #1, strSta & "," & strOff & "," & objAlign.name & "," &
varDataPnt(0) & "," & varDataPnt(1)
should look like this with your x,y data and dist from your sample
STATION OFFSET ALIGNMENT NORTHING EASTING
86+00.00 85.00' RT RW-17-35 1048504 153422.2
88+00.00 85.00' RT RW-17-35 1048424 153605.5
90+00.00 85.00' RT RW-17-35 1048344 153788.7
Thanks, Have a great day.
John Coon
"Matt W" wrote in message
news:4924462@discussion.autodesk.com...
If you prompt the user for a starting row (RowNum) you can use that as your
starting point.
Are you using Land Desktop? If so, you can also grab the station and offset
(left or right) along with the coords, based on a selected alignment.
--
It takes a big man to cry, but it takes a bigger man to laugh at that man.
"john coon" wrote in message
news:4924465@discussion.autodesk.com...
Matt W,
Man this is sweet! Thanks.
What a great start, you guys are the best.
Not being familiar with excel is there a way to specify the start location
for the first entry in excel like where your sample sets location based on
code below but
instead set location by the cursor. ONLY reason is ultimately I will use
this to populate existing excel sheets supplied by DOT and each sheet might
have a different start location. It looks like if I ask the user to specify
the start RowNum I could control the start. Is that correct?
I'll look to see how to connect to a existing or open excel file.
In the end I am going to add the station and offset values along with the
coords and area field. Based on the types of data that needs to be pushed to
the excel files I can see a few versions based on your core routine. I'm ok
with the land based information. I'll send a sample if you want after I get
a chance to step thru your routine and see how you did that.
I'm going to get a VBA for excel book tonight to see if I can do that.
oExcel.Range("A1").Select
oExcel.Range("A1").Value = "Starting Point"
oExcel.Range("C1").Select
oExcel.Range("C1").Value = "Ending Point"
oExcel.Range("D1").Select
oExcel.Range("D1").Value = "Distance"
This is wonderful again thank you, Have a great day.
John Coon
"Matt W" wrote in message
news:4924095@discussion.autodesk.com...
I just couldn't resist!!
Here's the real-deal; looping GetPoints that populate Excel.
I've also tweaked it so that Excel isn't visible until you either stop
picking points or cancel out of the command.
Hope you like it.
(I can't wait to format the spreadsheet for printing!)
--
It takes a big man to cry, but it takes a bigger man to laugh at that man.
"Matt W" wrote in message
news:4924065@discussion.autodesk.com...
As I promised, I'm back (and
I'm packing some code!!).
This will prompt the user to pick a starting point and an end point. It
will create an instance of Excel (it doesn't check to see if it's already
running). It will then input the coords of the two points.
I'll let you figure out the loop portion of picking points continuously (I
didn't want to take all of the fun away from you) 🙂
Let me know if you have any questions.
It's set to use Excel 2003. You can change the refe
rence to your specific
version of AutoCA
D.
--
It takes a big man to cry, but it takes a bigger man to laugh at that man.
"john coon" wrote in message
news:4924019@discussion.autodesk.com...
I'm trying to get the x's and y's autocad coordinate locations placed into a
open excel sheet by having the user pick the start cell by cursor. can I do
that?
sample would look like this where the row number is set by some focus by the
users.
row1cell1 row1c
ell2 row1cell3 row1cell4
x1,y1
to x2,y2 distance
I 'll need to check if excel is running if it is then select the cursor
location if not then message open summary excel file.
next issue is how do I have excel flip back to autocad to get the next two
points to be located and
have excel jump or drop one row for the next points location coordinates.
Would it be better to
set the excel location and then go to autocad and just pick as many
locations as y
ou want until end.
Any comments or dire
ction are welcome
Thanks
John Coon