Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble inserting block through lisp routine

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
US
I have all these lisp routines written for this program that draws out what I need. Instead of just using the oops command after creating my block (which doesnt get rid of the lines that my block consists of) I am trying to insert the newly created block. The problem is that for some reason the insert wont work for all of the 3 blocks i created, only one of them. Does anyone have any idea as to why I can't insert the blocks (they just wont show up at all.) But after my routine runs I can go to insert...block... and my blocks are there and insert with no problem. Does anyone have a clue?? and if not does anyone know of an easier way to maybe make a block and just keep the drawing there now in the block??? Any help would be greatly appreciated.
 
As to why block doesn't insert - try running the routine with cmdecho on, maybe you'll find a syntax error in the "command" line. As to making a block, not sure how you're doing it - drawing objects then using the "block" command? This should work, although a cleaner way may be to use the 'entmake' function.
Show some of your code, such as the block insert line(s), which may help us sort out the problem.
 
I use the block command to create the block and get rid of the lines. Than I want to insert the lines back but as a block this time. Below is the coding...but I dont thinkk that my creating the block or inserting the block is creating the problem. I am attempting to edit code that was written a few years ago, none of the programmers that wrote it are still around, and it's also poorly commented but here is the code for creating the block and inserting.

(command "-layer" "off" "dl" "" "")
(command "-layer" "off" "ol1" "" "")
(command "-layer" "off" "cl" "" "")

(command "-block" "cyc1" pt200 "w" pt1200 pt1201 "" ) ;oops removed 6/21
(command "insert" "cyc1" pt200 "" "" "") ;insert block with correct handle



(command "-layer" "on" "cl" "" "")
(command "-layer" "set" "cl" "" "")
(command "-layer" "off" "hl" "" "")
(command "-layer" "off" "ol" "" "")

(command "-block" "cyc1cl" pt200 "w" pt1200 pt1201 "") ;oops taken out 6/21
(command "insert" "cyc1cl" pt200 "" "" "") ;insert block with correct handle


If I leave the oops in the create block command it will keep the lines, or more correctly redraw the lines, but for some reason the insert wont work. I have combed throught the text window multiple times and have found no errors that would cause this. Also I am unfamiliar with the entmake function. If you dont mind, care to explain? Again sorry if this has nothing to do with it, because it is very possible that the error comes somewhere in the program, but it just didnt seem to make sense to me if I kept the oops in the block command that it would show up but wouldnt show up with the insert block. Thanks for the response I appreciate it.

Paul J.
 
I found the error and it was due to something else in the code. Why it generated the error I am not really sure but it is fixed. I will still be looking into the entmake function. thanks for the responses and sorry for the post.

Regards,
Paul J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top