Author Topic: VBA from 2k to 2k4  (Read 4700 times)

0 Members and 1 Guest are viewing this topic.

Elgin

  • Guest
VBA from 2k to 2k4
« on: April 20, 2004, 02:46:50 PM »
I have a vba script I used to use to extract the point data from an eagle point dwg direct to the project database in ldd3 but it will not work in ldd4. I know nothing about scripting or vba's and cannot remember where I got this vba from. Can anyone help me out please??

daron

  • Guest
VBA from 2k to 2k4
« Reply #1 on: April 20, 2004, 10:46:26 PM »
Maybe if you post the code or load it  on the web and link us to it?

Elgin

  • Guest
VBA from 2k to 2k4
« Reply #2 on: April 21, 2004, 09:09:58 AM »
I'll don one better, I'll post a link to it for everyone. Before anyone asks why not get an ascii file or use ep to extract the data, i've been down that road and this is simply so much easier than what i'd have to go through. it's a long sordid story (been buggin the boss about it for three years now). this is my best recourse that i can find.

www.segpa.biz/EaglePt2LDPt.dvb

Elgin

  • Guest
Re: VBA from 2k to 2k4
« Reply #3 on: July 18, 2006, 05:53:48 PM »
hey guys!!!  its a different version and this same vba no longer works again. is there anyone in here willing and able to update this vba for me? i will post a link again or post it here if so desired. the vba extracts the data from a drawing that contains eagle point point blocks and places that data inthe ldd points database. there is no alternative in my case other than this vba because the points data exists solely in these old drawings. there is no points file to get the data from. i appreciate the help guys!!

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: VBA from 2k to 2k4
« Reply #4 on: July 18, 2006, 06:06:47 PM »
With due respect, a few people are reticent to load a DVD from an unknown source into their systems. You may get a better response it you were to link to or post a TXT file.
.. if the same vein, some people viewing from work have limitations on their downloading capabilities. ... Just something to keep in mind.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Elgin

  • Guest
Re: VBA from 2k to 2k4
« Reply #5 on: July 18, 2006, 06:18:45 PM »
i would be more than happy to do that except that i have no idea how to convert the macro to a txt file. i can however point you in the direction of the original macro where i downloaded it from during version 02.  http://www.budcad.com/Downloads.htm#EP

will that be better??? thanks!!

Bob Wahr

  • Guest
Re: VBA from 2k to 2k4
« Reply #6 on: July 18, 2006, 06:41:56 PM »
Code: [Select]
Public Sub Blocks2Points()
On Error Resume Next
Dim cogoPnts As AeccCogoPoints
Dim newCogoPnt As AeccCogoPoint
Set cogoPnts = AeccApplication.ActiveProject.CogoPoints
   
Dim newPnt As Variant

Set SSET = ThisDrawing.SelectionSets.Add("temp3")
SSET.SelectOnScreen
For Each ent In SSET
Select Case ent.EntityType
Case 7
array1 = ent.GetAttributes
newPnt = ent.InsertionPoint
cogoPnts.NextPointNumber = array1(0).TextString
Set newCogoPnt = cogoPnts.Add(newPnt, kCoordinateFormatXYZ)
newCogoPnt.RawDescription = array1(1).TextString
newCogoPnt.Elevation = array1(2).TextString
End Select
Next
ThisDrawing.SelectionSets.Item("temp3").Delete
End Sub

Someome with LDD's going to have to get this as I don't know the LDD Object Model, but here's the code for anyone who wants to play.  This was in Module1.

Jeff_M

  • King Gator
  • Posts: 3977
  • C3D user & customizer
Re: VBA from 2k to 2k4
« Reply #7 on: July 18, 2006, 08:37:02 PM »
As I just helped someone over on the Adesk group with this, here are the directions for updating it:

 
Quote from: Me
Load ep2ldt.dvb
VBAIDE
In the Project window make sure the ep2ldt is the current project
Go to Tools->References
Unselect the Autodesk Land X.X Library
Scroll down and locate the Autodesk Land 6.0 Library and select it
Save and exit.

Note that the Land Type Library # is 1.2 for LDT2-3, 4.0 for 2004-2006 and 6.0 for 2007

DaveW

  • Guest
Re: VBA from 2k to 2k4
« Reply #8 on: July 18, 2006, 10:31:43 PM »
OMG, is that all he needed?

Elgin, follow Jeff's instructions.

You may get an error though. If so, do the same, but close the references dialouge box before adding the new reference as described below.

There is one slight issue there though. After you unselect the Autodesk Land X.X Library click ok
then go to tools, references again and select Autodesk Land 6.0 Library, then ok, then save, then exit.
« Last Edit: July 18, 2006, 10:34:42 PM by DaveW »

Elgin

  • Guest
Re: VBA from 2k to 2k4
« Reply #9 on: July 19, 2006, 08:17:25 AM »
Good morning guys. I appreciate the help. I had already been given that step and completed it. I am still getting an error: "Compile Error: Can't find project or library." The portion of the code that is highlighted in grey is the third line 'Dim cogoPnts As AeccCogoPoints'. In yellow is the first line. What shall I do next?

DaveW

  • Guest
Re: VBA from 2k to 2k4
« Reply #10 on: July 19, 2006, 10:48:56 AM »
I can take a look at it later today with Netmeeting.


If you are interested, please give me a call to arrange the time.
You can find my phone number on my website on the contact page at http://SmartLister.com

Good Luck,

Dave

Elgin

  • Guest
Re: VBA from 2k to 2k4
« Reply #11 on: July 19, 2006, 11:32:35 AM »
 :?  I've never used Netmeeting so I am unsure of its requirements (as pertains to the firewall etc). Perhaps I could walk through this on the phone with someone? I am certain the other party would have to have LDD though. I wish I knew lisp and vba. Just not enough brain cells firing to learn that and all this surveying and management stuff at the same time.

Jeff_M

  • King Gator
  • Posts: 3977
  • C3D user & customizer
Re: VBA from 2k to 2k4
« Reply #12 on: July 19, 2006, 12:24:25 PM »
Elgin, you don't say what version you are trying to update to......

Elgin

  • Guest
Re: VBA from 2k to 2k4
« Reply #13 on: July 19, 2006, 12:30:28 PM »
I'm in 2007 now.

Atook

  • Swamp Rat
  • Posts: 960
Re: VBA from 2k to 2k4
« Reply #14 on: July 19, 2006, 12:45:49 PM »
Elgin, If you’re in the VBA window, (all the code etc) press the stop button to stop execution of any code (Or go up to Run->Reset) After that, go up to (Tools->References) there you can uncheck the missing reference, and check the new reference (LDD 6.0)

Note: To get to the VBA window from LDD try Tools->Macro or press Alt+F11.