feargt Posted June 5, 2009 Posted June 5, 2009 Hi, I have received a survey drawing. The drawing consist of blocks. The blocks consist of a point and beside the point is text. The text is the actual ground elevation. The block itself is on 0 elevation in the drawing. I need to make a ground model. Is there a method or a lisp file that can read the txt in the block and then move the block to this elevation? Any and all ideas welcome......... Quote
David Bethel Posted June 5, 2009 Posted June 5, 2009 There would be a lot of things to verify or need to know: Do you know the block name Is it TEXT or MTEXT Is the text in a decimal format Is everything in the same UCS Are you sure that is only 1 TEXT in the BLOCK -David Quote
feargt Posted June 5, 2009 Author Posted June 5, 2009 There would be a lot of things to verify or need to know: Do you know the block name Is it TEXT or MTEXT Is the text in a decimal format Is everything in the same UCS Are you sure that is only 1 TEXT in the BLOCK -David Hi David, I've posted a copy of the block I've just discovered another problem due to you asking the name. but first: It is Mtext. Decimal format with 2 decimal places ie. 64.65 Yes everything in same UCS Only 1 text in each block. Newly discovered problem is as follows: When I select the block the name is *U155 In the original drawing I cannot find the original name of the block. When I select the block *U155 I cannot open block editor, I get a dialogue box asking me to choose which block I wish to edit, but this list is empty. neuer block.dwg Quote
David Bethel Posted June 5, 2009 Posted June 5, 2009 The "*Unnn" BLOCK name indicates that it is an anonymous block. That makes thing more difficult but not impossible. Let me see what I can round up. -David Quote
Lee Mac Posted June 5, 2009 Posted June 5, 2009 When I select the block the name is *U155 In the original drawing I cannot find the original name of the block. When I select the block *U155 I cannot open block editor, I get a dialogue box asking me to choose which block I wish to edit, but this list is empty. Sounds like an Anonymous block... {EDIT} : David beat me to it Quote
David Bethel Posted June 5, 2009 Posted June 5, 2009 Something like this should work: [b][color=BLACK]([/color][/b]defun c:txt2zin [b][color=FUCHSIA]([/color][/b]/ ss i en ed bn ip bd fe fd bl z[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]not ss[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]princ [color=#2f4f4f]"\nSelect INSERTS To Change: "[/color][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"INSERT"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]if [b][color=RED]([/color][/b]getvar [color=#2f4f4f]"CTAB"[/color][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cons 410 [b][color=PURPLE]([/color][/b]getvar [color=#2f4f4f]"CTAB"[/color][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cons 67 [b][color=PURPLE]([/color][/b]- 1 [b][color=TEAL]([/color][/b]getvar [color=#2f4f4f]"TILEMODE"[/color][b][color=TEAL])[/color][/b][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq i [b][color=NAVY]([/color][/b]sslength ss[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]not [b][color=MAROON]([/color][/b]minusp [b][color=GREEN]([/color][/b]setq i [b][color=BLUE]([/color][/b]1- i[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq en [b][color=MAROON]([/color][/b]ssname ss i[b][color=MAROON])[/color][/b] ed [b][color=MAROON]([/color][/b]entget en[b][color=MAROON])[/color][/b] bn [b][color=MAROON]([/color][/b]cdr [b][color=GREEN]([/color][/b]assoc 2 ed[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] ip [b][color=MAROON]([/color][/b]cdr [b][color=GREEN]([/color][/b]assoc 10 ed[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] bd [b][color=MAROON]([/color][/b]tblsearch [color=#2f4f4f]"BLOCK"[/color] bn[b][color=MAROON])[/color][/b] fe [b][color=MAROON]([/color][/b]cdr [b][color=GREEN]([/color][/b]assoc -2 bd[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]if [b][color=MAROON]([/color][/b]not [b][color=GREEN]([/color][/b]member bn bl[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq bl [b][color=GREEN]([/color][/b]cons bn bl[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while fe [b][color=MAROON]([/color][/b]setq fd [b][color=GREEN]([/color][/b]entget fe[b][color=GREEN])[/color][/b] fe [b][color=GREEN]([/color][/b]entnext fe[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]and [b][color=GREEN]([/color][/b]wcmatch [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 0 fd[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] [color=#2f4f4f]"*TEXT"[/color][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq z [b][color=BLUE]([/color][/b]atof [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 1 fd[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entmod [b][color=BLUE]([/color][/b]subst [b][color=RED]([/color][/b]cons 10 [b][color=PURPLE]([/color][/b]list [b][color=TEAL]([/color][/b]car ip[b][color=TEAL])[/color][/b] [b][color=TEAL]([/color][/b]cadr ip[b][color=TEAL])[/color][/b] z[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]assoc 10 ed[b][color=RED])[/color][/b] ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]if [b][color=NAVY]([/color][/b]> [b][color=MAROON]([/color][/b]length bl[b][color=MAROON])[/color][/b] 1[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]alert [color=#2f4f4f]"\nMore Than 1 BLOCK Name Was Found"[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] Be very careful and verify 'cause there isn't any error checking here. AS IS -David Quote
feargt Posted June 5, 2009 Author Posted June 5, 2009 Hi David, Thanks a million, that did exactly what I wanted. I have just seen another problem though. The insertion point for the block should be on the point in the centre of the circle in the block. I have no idea how this survey was made or how the blocks were inserted. Is there anyway to move the text in the block so that the text insertion point is on top of the point in the circle. Apologies upfront, I had no idea this was going to turn out so awkward. Quote
David Bethel Posted June 5, 2009 Posted June 5, 2009 Are you saying that center of the circle AND the text mid point should be at 0,0? -David Quote
feargt Posted June 5, 2009 Author Posted June 5, 2009 Forget tha last problem, am making mountains out of molehills. I just exploded the blocks and was able to filter just the circles, and they have the correct z value......... Thanks a million again for your time!! much appreciated and much time saved. I had 10,000 blocks in the drawing! 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.