Jump to content

Recommended Posts

Posted

I am attempting to make a modified version of the ATTIN command in order to automate the process; removing user prompts, specifying file import location, and batch processing from a specified directory. But I have run into a wall, and I am very new to LISP (about 3 weeks new now).

 

This is a process I developed for my company to update title-block attribute tags more uniformly, reducing user input error when doing what is sometimes hundreds of drawings. Now that I am finally teaching myself Autolisp I'm trying to take it a step further.

 

Thus far I have eliminated or worked around (defined variables) for all of the user prompts (file location, yes_no box, etc.). I have used found code to write a script to run this lisp on all drawings in a defined directory, as well as modified the single user selection to a global search with an added parameter of "(8 . "TB_LAYER") so that it only looks at blocks with attributes on this layer. This is to avoid the "acet-alert" box when blocks that do not have matching tag names are found, which stops the batch routine, and causing an alert box loop that freezes AutoCAD.

 

The issues I am having trouble pinpointing are that when I run this routine on a single drawing with the correct parameters, it works like a charm. It successfully updates the block with the new information without any input required from the user. However, when the script runs it I get a "No handle found" return that doesn't end the script, but doesn't successfully rewrite the attributes. I'm at a loss because the script simply opens the drawing, runs the command individually, saves, and closes the drawings. So I can't understand why it doesn't work the same way as if i ran it on a per drawing basis.

 

Any help would be appreciated, as i said before i am very new to lisp coding, so it may be plain as day to some of you. Please be gentle :)

attimport.lsp

Posted

I think i have narrowed down the issue to the "a" variable. This variable would normally be associated with the block handle matching the original handle created by "attout", I think. Since handles do not match drawing to drawing, block to block, i removed it along with the block name from my source text file.

 

When normally run, this would prompt the user to specify a block selection to search for matching attribute tags. I have overwritten this selection by telling it to look at the whole drawing for blocks with attributes on a particular layer, or by block name (410 . "block name here") in variations i have used. I believe this is for some reason creating a conflict or the message itself "No handle specification" being present is hanging up the process when ran from a script. I still do not know why it works when ran individually without returning this message, and why this only occurs during the script, but it's a start.

 

Can anyone look to confirm that I may be on the right track?

 

Thanks

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