Jump to content

Insert Part Description to be read by an Outside Program.


dblclkmatt

Recommended Posts


(defun c:BLK () 
(setq PT (getpoint "Insertion point ??? "))
(setq ATT1 (strcat "PART_NAME=" 
	(setq *shp*
			(
   				(lambda ( input ) (if (eq "" input) *shp* input))
   				(getstring (strcat "\nShop Order ??? <" (setq *shp* (cond (*shp* ) ( "41000" ))) "> : "))
			)
	)
"-" (getstring "\nItem Number ??? ")
))

(setq ATT2 (strcat "MATERIAL=" 
	(setq *mtrl*
			(
   				(lambda ( input ) (if (eq "" input) *mtrl* input))
   				(getstring (strcat "\nMaterial ??? <" (setq *mtrl* (cond (*mtrl* ) ( "A36" ))) "> : "))
			)
	)
))

(setq ATT3 (strcat "THICKNESS=" 
	(setq *thck*
			(
   				(lambda ( input ) (if (eq "" input) *thck* input))
   				(getstring (strcat "\nThickness ??? <" (setq *thck* (cond (*thck* ) ( "1.00" ))) "> : "))
			)
	)
))

(setq ATT4 (strcat "QUANTITY=" 
	(setq *qty*
			(
   				(lambda ( input ) (if (eq "" input) *qty* input))
   				(getstring (strcat "\nQuantity ??? <" (setq *qty* (cond (*qty* ) ( "1" ))) "> : "))
			)
	)
))

(setq ATT5 (strcat "REMARKS=" (getstring "Remarks ??? ")))

(command "-insert" "part_block" PT 1.0 1.0 0 ATT1 ATT2 ATT3 ATT4 ATT5)

(princ)
)

 

 

So this lsp has been serving me well in conjunction with the "part_block.dwg" since 2014. However, I recently upgraded my machine while keeping the same AutoCAD. Somehow this no longer works. The prompts come up just like normal, but after the last prompt it inserts the block as if I hadn't answered the prompts at all, opens the attributes dialog box for the "part_block.dwg" and after I hit "OK" it displays this on the command console.

 

Command: BLK
Insertion point ???
Shop Order ??? <41000> : 67975
Item Number ??? 01
Material ??? <A36> :
Thickness ??? <1.0> : 1.25
Quantity ??? <1> : 4
Remarks ??? NO-KERF
Unknown command "PART_NAME=67975-01".  Press F1 for help.
Unknown command "MATERIAL=A36".  Press F1 for help.
Unknown command "25".  Press F1 for help.
Unknown command "QUANTITY=4".  Press F1 for help.
Unknown command "REMARKS=NO-KERF".  Press F1 for help.

 

Anyone have anything thoughts? I'm so used to using this method it's messing up my workflow.

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • dblclkmatt

    11

  • BIGAL

    6

  • ReMark

    4

  • steven-g

    2

Top Posters In This Topic

Posted Images

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