d2cad Posted October 13, 2010 Posted October 13, 2010 I have been fighting with this for some time now: In a drawing that containes blocks with attributes, blocks with blocks with attributes AND xrefs with blocks with attributes. I need to extract some attributetags AND the X, Y and Z-coordinate. With ATTEXT and a filterfile I have got it working, BUT... Sometimes the ATTEXT-file that is created displays some strange values in the coordinates. Sometimes numbers are very small or very large, but the XREF-drawing shows no entities on that coordinates. For example 3.277566e-99 of 4.19987e125. These numbers cannot be transferred and used for the rest of the program. How can I fix this so it reads the real coordinates from the XREF/block and not some strange 'mutant'-code??? Quote
BlackBox Posted October 13, 2010 Posted October 13, 2010 Congrats on your first post, and welcome to the forums! Try looking into the trans function. Quote
Tharwat Posted October 13, 2010 Posted October 13, 2010 (edited) Check post - 3 and read the link that was given by Lee for more information about numbers . http://www.cadtutor.net/forum/showthread.php?53024-Reducing-long-line-of-numbers Regards, Tharwat Edited October 13, 2010 by Tharwat Link wasn't added by mistake, and reminded by Mr Renderman Quote
BlackBox Posted October 13, 2010 Posted October 13, 2010 Check post - 3 and read the link that was given by Lee for more information about numbers . Tharwat, buddy... you are post #3 (in this thread), and you forgot to paste the link. :wink: Quote
Tharwat Posted October 13, 2010 Posted October 13, 2010 Tharwat, buddy... you are post #3 (in this thread), and you forgot to paste the link. :wink: Thanks dear Buddy Renderman. I am so sorry . I will upload it right now. Thanks Quote
BlackBox Posted October 13, 2010 Posted October 13, 2010 Thanks dear Buddy Renderman. No worries, Tharwat. Quote
d2cad Posted October 13, 2010 Author Posted October 13, 2010 That's all nice, but the real coordinate is by example 345.23 and in the ATTEXT-file 3.277566e-99... That's my problem. I tried using trans, but I get an error because also trans can't read it to translate as a point... Quote
BlackBox Posted October 13, 2010 Posted October 13, 2010 The difference in coordinate value is changing either when you get the coordinate, or when you write it to a file. I tried using trans, but I get an error because also trans can't read it to translate as a point... This makes no sense (to me). You must be passing a string instead of a point list, to the trans function. What error? What does it say exactly at the command prompt? What UCS are you using when you get your coordinates? These are just a couple of questions that you should clarify. Also, in this case please post your code, if you want someone to be able to help you without telepathy. Quote
Lee Mac Posted October 13, 2010 Posted October 13, 2010 This makes no sense (to me). You must be passing a string instead of a point list, to the trans function. I believe d2CAD refers to the ATTEXT command (Express Tools), resulting in an erroneous result in the output file, I am not sure of the reason, but it would be difficult to 'intervene' with the Express Tools LISP without editing the code itself. Perhaps this may offer another option (although it doesn't extract handles, hence not compatible with ATTIN). Lee Quote
BlackBox Posted October 13, 2010 Posted October 13, 2010 I believe d2CAD refers to the ATTEXT command (Express Tools), Thanks for the clarification, Lee. With the LISP question, I thought (incorrectly) that the OP was attempting to write their own custom code to the same (with their twist) . Hence the trans suggestion. Quote
Lee Mac Posted October 13, 2010 Posted October 13, 2010 With the LISP question, I thought (incorrectly) that the OP was attempting to write their own custom code to the same (with their twist) . Hence the trans suggestion. I doubt that trans would solve the issue however, as the data is in OCS/WCS and hence not affected by UCS coordinate transformations. Quote
David Bethel Posted October 13, 2010 Posted October 13, 2010 ATTEXT is a core command. My guess is that there is a problem with the template file. -David Quote
Lee Mac Posted October 13, 2010 Posted October 13, 2010 ATTEXT is a core command. My guess is that there is a problem with the template file. -David Ahh! I'm getting confused with ATTOUT thanks David Quote
David Bethel Posted October 13, 2010 Posted October 13, 2010 That's all nice, but the real coordinate is by example 345.23 and in the ATTEXT-file 3.277566e-99... That's my problem.I tried using trans, but I get an error because also trans can't read it to translate as a point... D2CAD, Can you exapnd a bit on the procedure that you are using? Which output format do you use? Can you post the extraction template ( .txt ) file? Are you using the command line or a dialog box? OR running it through a script? 3.277566e-99 is a very small number. Very close to zero. -David Quote
d2cad Posted October 13, 2010 Author Posted October 13, 2010 Yes, Lee Mac is right: I use the standard AutoCAD command ATTEXT and sometimes it gives an error. The ATTIN and ATTEX which are Express Tools, don't work for me. The reason for using ATTEXT is that it is the only way to read XREF-content AND blocks in the XREF. At least I am told it is the only way... Quote
BlackBox Posted October 13, 2010 Posted October 13, 2010 I use the standard AutoCAD command ATTEXT and sometimes it gives an error. Again, I think it would be helpful, if you were to tell us exactly what the error says at the command prompt. Quote
d2cad Posted October 13, 2010 Author Posted October 13, 2010 Again, I think it would be helpful, if you were to tell us exactly what the error says at the command prompt. OK: Command: spln This starts the lisp ...Processing...| Selecteer viewport : invalid point: (3.21575e+125 0.0 0.0) Select Viewport and start calculating with the coordinates. Here is goes wrong. De appliatie is onderbroken Error message This is a part of the ATTEXT-file: 0.000, 0.000, 0.000,'101300', 1.0, 0.000, 1.000, 1.000, 1.000 First item. Nothing wrong 321574651479938244946765735221561044454574584960937500000000000000000000000000000000000000000000000000000000000000000000000000, 0.000, 0.000,'102230', 1.0, 0.000, 1.000, 1.000, 1.000 Second item. Very large X-coordinate. This should be: 0.000, 0.000, 0.000,'102230', 1.0, 0.000, 1.000, 1.000, 1.000 The routine first sets to WCS and then selects all items in ModelSpace and after selecting the viewport, it usese trans-command to place labels in PaperSpace. 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.