RLKHydro Posted March 9, 2001 Share Posted March 9, 2001 We have created the layout for a pipe system for dewatering a client's property. I've manually entered 3D loci at 50' intervals with the correct z value for the pipe elevation. Now we need to export the xyz's of these loci to a text file to give to a surveyor so the points can be marked on the property. (the values must be a plain text file so it can be downloaded to their survey instrument.) Phone calls to tech support yield no good solution--we tried exporting to VectorScript, but the resulting xyz values have been shifted and no longer have the correct coordinates (not to mention that you have to edit out about 90% of the file). Any other ideas out there? We can, of course, give them an exported .dwg file and ask them to create the text file for us, but it would certainly be more professional to be able to hand them the data they are asking for rather than asking them to do it for us. Barb Nelson RLK Hydro, Inc. Quote Link to comment
mikeconner Posted March 9, 2001 Share Posted March 9, 2001 A job for VectorScript. If you are going to use VW alot, it pays to learn how to script. The script below will do what you want. When you run it, it will first give you a save file dialog that lets you put the file where you want it and name it how you want it. It produces a tab delimited file with the x, y, and z coordinates. It only processes the 3D loci in the active layer. If you don't know how to install and run a script, see the manual. I have only tested this on a Mac (with VW 8.5.2) but it should work on Windows as well. You might also want to subscribe to the genreal email support list and the VS list, see http://www.nemetschek.net/support/mailinglists.html. {The script begins below, this is a comment line} procedure coord; var x,y,z:real; i:integer; obj:handle; ofile:string; begin obj:=factlayer; PutFile('Output file', ' ', ofile); write('X'); tab(1); write('Y'); tab(1); writeln('Z'); while obj<>NIL do begin i:=GetType(obj); if (i=9) then begin GetLocus3D(obj,x,y,z); write(x); tab(1); write(y); tab(1); writeln(z); end; obj:=nextobj(obj); end; close(ofile); end; run(coord); {This comment line ends the script} Quote Link to comment
RLKHydro Posted March 14, 2001 Author Share Posted March 14, 2001 Thank you, Mike! That is a big help. Barb Quote Link to comment
mikeconner Posted March 14, 2001 Share Posted March 14, 2001 Glen, I'm not sure what you mean by this, where are the point nums and descriptors? In record formats for some objects or in a worksheet? Sounds like you are talking about survey points; there is a plug-in script with DTM module that imports this type of data to make 3D loci for the DTM. Give me some more details and I might be able to point you in the right direction. Mike Quote Link to comment
Glenn Troyer Posted March 15, 2001 Share Posted March 15, 2001 Mike, I'll try to be more specific. What I would like to do is export the survey points such as 3D loci with point numbers,xyz and descriptors as a tab delimited text file. I have used the 'Import Survey File' plug in. That works great. I need an 'Export Survey File' plug in. I am seriously considering getting a robotic total station. I am trying to determine whether I can use VectorWorks to accomplish the job or if I need to go with a full-blown surveyor program. Glenn Veal4me@aol.com Quote Link to comment
Glenn Troyer Posted March 15, 2001 Share Posted March 15, 2001 Is there a script available to export point #, x, y, and z coordinates, and descriptors? Glenn Troyer Veal4me@aol.com Quote Link to comment
mikeconner Posted March 15, 2001 Share Posted March 15, 2001 Glen, Yes, this certainly would be possible, though I don't know if there are any canned scripts to do it that ship with VW. In 8.5.2 or earlier, I would guess that you would have to attach a record format to the loci in which you would have fields for the point number and the description. You could then have a script similar to the one I posted that gets the coordinates of the loci as well as the record information to write to the text file. An alternative would be to attach a record format to the loci and then get the info into a VW worksheet database; you could then just export the worksheet with the menu command. The problem with this is that in 8.5.2, there is no worksheet function for the z value, though there are ones that give you the x and y center. This means you would have to get the z value into the record format first, which could be done manually or with a VectorScript that gets the z value and writes into the a field of the record. I don't know if VW 9 will change this situation. There is another way that would require no additional scripting: just use the script I posted, import the text file into Excel or some other program, and add the point numbers and descriptors there, then export as a file that can be loaded into your total station. The first method would probably be the best; once the record format is attached to the loci and the point number and description entered, you would just have to add a few lines of code to the script I posted to get that info into the exported file.It wouldn't be hard to write a script that went through the 3Dloci, automatically assigned the point number and asked you for a description, then wrote this info to the record. You might try subscribing to the VS mailing list and the general VW mailing list (see the link in my original reply to RLKHydro). You might find someone who has already done this or could tell you if any of the examples that come with VW have this capability. If necessary, I could help you develop the system, I think I've got a some scripts that read out record format information.Feel free to email me directly. Mike michaelconner@smsu.edu Quote Link to comment
RLKHydro Posted March 15, 2001 Author Share Posted March 15, 2001 Mike, We got the script to work with no problems, nicely done. However, the xy values are shifted, the same way they are when you use the File/Export/Export VectorScript... command. We can work around this by including a known point in our list of exported points and shifting everything in an Excel spreadsheet, but I'm curious why they get shifted. any ideas? (the z values export correctly). Thanks also for the reminder about the listserv, I was already subscribed but had been nomail for months. I'd forgotten what a great resource it is! Barb Nelson RLK Hydro, Inc. Quote Link to comment
mikeconner Posted March 16, 2001 Share Posted March 16, 2001 Barb, This probably has to do with you having used the move page tool at some point while in a view other than top/plan. I'm a little hazy on all the details, but VW in some way relates the origin to the page center (the default). In previous versions, using Move Page at any time caused a shift between the stored coordinates (what you see in a VS export file or what you get with a function like Get3DLocus) and those shown on screen. In 8.5.2, I believe this problem only crops up when you use Move Page in a view other than top/plan (though I'm not certain of this). I know I haven't run into it for awhile even though I do a lot of coordinate work and use the move page tool but I do little 3D work.It may also only be a problem for some types of objects, 3D Locus being one. You might be able to reset things by going to top/plan view, recording the coordinate of a locus from the Info Palette, then use the Set Origin command to reset the origin to page center, then Set Origin again and use the Next Mouse Click Is: option; enter the coordinates of the locus, then snap to the locus after hitting ok. I'm not positve that this will work, but it is worth a try. Should do it on a copy of your work file first as a test. People have been complaining about this for years; it is supposedly fixed completely in VW 9 with its new floating point base. Mike Quote Link to comment
mikeconner Posted March 16, 2001 Share Posted March 16, 2001 A little more work showed that the problem is with 3D loci. This object always reports x and y relative to the page center, so if you move the origin from there you get x and y values in VectorScript that aren't what you see on screen. Other objects don't behave this way (at least some don't). The script below corrects for this problem. Mike {The script begins below, this is a comment line} procedure coord; var x,y,z,ox,oy:real; i:integer; obj:handle; ofile:string; begin getorigin(ox,oy); obj:=factlayer; PutFile('Output file', ' ', ofile); write('X'); tab(1); write('Y'); tab(1); writeln('Z'); while obj<>NIL do begin i:=GetType(obj); if (i=9) then begin GetLocus3D(obj,x,y,z); x:=x-ox; y:=y-oy; write(x); tab(1); write(y); tab(1); writeln(z); end; obj:=nextobj(obj); end; close(ofile); end; run(coord); {This comment line ends the script} Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.