Clifford169 Posted December 9, 2016 Posted December 9, 2016 Long timer user first time poster. I have an old survey that we don't have the raw data for anymore. There are levels associated (in text form) to the nodes we have created from LSS, however the nodes themselves are all 2D. Is there a way to tell those nodes to shift their Z value to the height in the text line? I'm used to using LISPs though I'm not much of a writer for them! Looking forward to your responses. Quote
hanhphuc Posted December 9, 2016 Posted December 9, 2016 (edited) Long timer user first time poster. I have an old survey that we don't have the raw data for anymore. There are levels associated (in text form) to the nodes we have created from LSS, however the nodes themselves are all 2D. Is there a way to tell those nodes to shift their Z value to the height in the text line? I'm used to using LISPs though I'm not much of a writer for them! Looking forward to your responses. hi welcome to CADtutor there are many examples here's quick & dirty (defun c:TXZ (/ ss i l[color="red"] vo p[/color]) [color="red"](princ "\nSelect TEXT.. ")[/color] (if (setq ss (ssget ":L" '((0 . "TEXT")))) (repeat (setq i (sslength ss)) (setq i (1- i) l (mapcar ''((x) (vlax-get (setq vo (vlax-ename->vla-object (ssname ss i))) x)) '(TextString InsertionPoint) )) (if (numberp (read (car l))) [color="red"](progn[/color] (vla-put-InsertionPoint vo (vlax-3d-point [color="red"](setq p[/color] (list (caadr l) (cadadr l) (atof (car l)))))) [color="red"](entmakex (list '(0 . "POINT")(cons 10 p)))[/color] [color="red"])[/color] ) ) ) (princ) ) Edited December 9, 2016 by hanhphuc Quote
Clifford169 Posted December 9, 2016 Author Posted December 9, 2016 hi welcome to CADtutorthere are many examples here's quick & dirty (defun c:TXZ (/ ss i l) (if (setq ss (ssget ":L" '((0 . "TEXT")))) (repeat (setq i (sslength ss)) (setq i (1- i) l (mapcar ''((x) (vlax-get (setq vo (vlax-ename->vla-object (ssname ss i))) x)) '(TextString InsertionPoint) )) (if (numberp (read (car l))) (vla-put-InsertionPoint vo (vlax-3d-point (list (caadr l) (cadadr l) (atof (car l))))) ) ) ) (princ) ) This is excellent for giving the text a Z value; is there a way to give the node it is next to the same value? Quote
hanhphuc Posted December 9, 2016 Posted December 9, 2016 This is excellent for giving the text a Z value; is there a way to give the node it is next to the same value? code updated Quote
Clifford169 Posted December 9, 2016 Author Posted December 9, 2016 code updated Thanks. I have also come to a similar result using something additional from another thread, which creates a point at the text insertion. The above code doesn't seem to provide the point with a Z value, however. I'm happy with how this acts as it stands. My next question would be, is there a quick way to match the Z properties of a text object to a block/line? Quote
hanhphuc Posted December 9, 2016 Posted December 9, 2016 ... is there a quick way to match the Z properties of a text object to a block/line? Yes it is possible by matching to the nearest point (brute force) but there are problems time to process many points also how to over come if more points share the same coordinates on the block line etc.. Quote
Clifford169 Posted December 9, 2016 Author Posted December 9, 2016 Yes it is possible by matching to the nearest point (brute force) but there are problems time to process many points also how to over come if more points share the same coordinates on the block line etc.. Annoyingly but fortunately, the surveyor on the job has managed to find his original survey data, so I will be able to process it through from scratch and retrieve the data I need from that. This has been a problem before though, and I'm sure this info will be useful for future tasks. Thanks for all your help thus far! Quote
halam Posted December 9, 2016 Posted December 9, 2016 Very useful. I wonder if it would be possible to get this to work with a attributed block in stead of a plain text.Or maybe this allready it exists. The labeling comes in block form in many occasions. Quote
hanhphuc Posted December 9, 2016 Posted December 9, 2016 Yes our surveyors are using Geomax as we use lisp to output data attributes as point ID, with 3 tags Index Level Code and a node, the attribute layer inserted base on surveyor's point code. It's easy to handle using express tools ATTOUT ATTIN or customized lisp etc to manipulate these datas Quote
BIGAL Posted December 9, 2016 Posted December 9, 2016 1 thing to watch out for when converting text is where is the text relative to the point, if you use insertion point say bottom left but we can make text so the decimal point is the actual point location so a x,y error. To get around this just check and move "all" text if required before making 3d points. Most times its better than nothing. Quote
Roy_043 Posted December 9, 2016 Posted December 9, 2016 so the decimal point is the actual point locationWhat do you mean by 'decimal point' here? Quote
BIGAL Posted December 10, 2016 Posted December 10, 2016 Our other civil software can place the text say 123.456, the actual survey point lines up with the decimal point 123X456 so the insert point lower left is offset from the true location of the point. A very slight error in the x,y. I have had text come in like a metre away from the actual survey point its all about how it was created. I have 30 years doing this. Quote
Roy_043 Posted December 10, 2016 Posted December 10, 2016 @BIGAL: I do not doubt your experience but do doubt the wisdom of this approach. Unless these texts are in fact custom entities, choosing a different font or text size must really screw things up... Quote
Roy_043 Posted December 10, 2016 Posted December 10, 2016 @BIGAL: After reconsideration I come to the conclusion that your interpretation may in fact be wrong. For most "TEXT" alignments the insertion point (the point a user would snap to) is represented by the TextAlignmentPoint (group code 11) and not the InsertionPoint (group code 10). It seems you may not be aware of this. So IMO the offset you perceive probably does not exist if you look at the correct property. Quote
hanhphuc Posted December 11, 2016 Posted December 11, 2016 (edited) hey guys sorry for interrupting Our other civil software can place the text say 123.456, the actual survey point lines up with the decimal point 123X456 so the insert point lower left is offset from the true location of the point. A very slight error in the x,y. I have had text come in like a metre away from the actual survey point its all about how it was created. I have 30 years doing this. sometimes we received these kind of topo drawing from consultant where 2D level text without node/point we can not use text insertion point as node position due to text is 1.BL-justified 2.we figured out their surveyed node should be nearby text Bottom Centre or offset somewhere "decimal point" 3.sometimes with different rotation eg: 45° etc.. ...choosing a different font or text size must really screw things up... This is the fact.. ... your interpretation may in fact be wrong Maybe Roy misunderstood about BIGAL's concept, in fact it's just a normal AcDbText entity, 3rd party software only puts Text & node position in different way, to clarify Have a look in this LOT A150 TOPO.dwg Edited December 11, 2016 by hanhphuc upload drawing & image Quote
Roy_043 Posted December 11, 2016 Posted December 11, 2016 @hanhphuc: Well, what can I say, I am stunned and I stand corrected. I am hardly a 'spring chicken' myself, so I have seen some weird CAD stuff. But this takes the biscuit. My apologies to BIGAL. Quote
BIGAL Posted December 12, 2016 Posted December 12, 2016 No worries. Thanks hanhphuc went looking for a sample as well I have seen text 750 mm away from actual survey point. The 52mm error is probably acceptable when you are starting with nothing. This is the screen for our other software note the horizontal offset value. Quote
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.