Jump to content

ATTEXT in Lisp


d2cad

Recommended Posts

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???

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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):oops: . Hence the trans suggestion.

Link to comment
Share on other sites

With the LISP question, I thought (incorrectly) that the OP was attempting to write their own custom code to the same (with their twist):oops: . 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...