Quantcast
Viewing all articles
Browse latest Browse all 14319

Tool Palette insert killing VL-CMDF "_.pasteblock" in AutoCAD2011

Hi all, I discovered something that does not seem to be documented here on the forums, and maybe not even when searching Google for answers.

 

With a lot of help, I have developed an elaborate dynamic block insertion routine that inserts a dynamic block at 0,0 then modifies several of the dynamic properties to match certain running defaults( which the user can pre-set in a dialog box), then copybase's the modified block, erases the original, and prompts the user to paste the copy, then rotate it. It feels like using a block insert tool from the tool palette since you are not prompted for x or y scale, and this lisp launches from a palette tool and looks just like a block insertion tool on a tool palette.

 

I have put together over a dozen palettes with these tools now and they work flawlessly. However, I had to put together two more palettes full of much simpler symbolic blocks which don't require this elaborate program, so I simply used the tool palette insertion tool to do the job. I just dragged my blocks from the correct folder to an empty tool palette and took it from there - easy as pie.

 

However, that's when I started noticing that after inserting one of the simple blocks, my complex dynamic block program would crash out sometime during the insertion process. I went down several dead ends until I figured out that using the tool palette insert tool seems to change several typical AutoCAD Command user interaction sequences. This may only cause an annoyance to the typical user, but to the programmer who is already walking on thin ice by using (command "-insert" NAMEVARIABLE "Scale" 1 "Rotate" "0" "0,0"), any divergence from this structure causes errors.

 

I eventually figured out that the string sequence above actually works, but my program stops because the subsequent "_.pasteblock" command also acts differently after using an insert tool from the tool palette. Before using the toolpalette tool, pasteblock only prompts for insertion point. After using the toolpalette tool, pasteblock asks for insertion and rotation!

 

Interestingly enough, this seems to not effect AutoCAD 2014 - maybe they corrected this? Unfortunately, my tools need to work in earlier versions too.

 

Does anyone know of a setting or method to force uniformity when issuing pastblock through lisp? Any help greatly appreciated.

 

Attached is a simple version of what i need to run. You can use it for testing by just creating any simple block and putting it in the path (SETQ BLK-N-PTH  "C:/CAD/TEST.DWG").

 

After running the lisp to insert, create a tool palette insert of a different block and test it. Now test this program again and you will encounter two calls for rotation!

 

 

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 14319

Trending Articles