digitalcarbon Posted January 15, 2009 Share Posted January 15, 2009 attached is a sample file. if you select a road and view the data pane you will see that all the roads have been given names. you need to scroll down a bit. now, i want to see those names pasted in my drawing next to my road. so i cut & paste, but can a script be written that can do the cut and paste for me? in other words, i select all the roads and then run the script and all the roads in my drawing have the road names next to them for me to then rotate/align w/ the road. how hard is this? Quote Link to comment
panta rhei Posted January 15, 2009 Share Posted January 15, 2009 Try this: PROCEDURE ExtractAttribute; { ? Petri Sakkinen 1995 - 2009 } CONST rName = 'Emergency_rds_lineRec'; attr = 'Street'; VAR strData : STRING; x, y, dist, rotA : REAL; tangent, location : VECTOR; ok : BOOLEAN; obHd : HANDLE; BEGIN obHd := LSACTLAYER; WHILE NOT(obHd=NIL) DO BEGIN strData := GETRFIELD(obHd, rName, attr); dist := HPERIM(obHd)/2; ok := POINTALONGPOLY(obHd, dist, location, tangent); x := location.x; y := location.y; rotA := VEC2ANG(tangent); TEXTORIGIN(x, y); CREATETEXT(strData); HROTATE(LNEWOBJ, x, y, rotA); obHd := PREVSOBJ(obHd); END; END; RUN(ExtractAttribute); Set default text attributes to your liking before running it. Quote Link to comment
digitalcarbon Posted January 15, 2009 Author Share Posted January 15, 2009 wow, that did it! thank you very much i need to learn vector script. any suggestions? Quote Link to comment
panta rhei Posted January 15, 2009 Share Posted January 15, 2009 You're welcome. It's a very old script, but you prompted me to finally update it to create rotated text. The best (only?) resource for learning VS is VectorLab. http://www.vectorlab.info/index.php?title=Main_Page 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.