Jump to content

What's wrong with this attach code


mit

Recommended Posts

Hello everyone

 

I have some problem about this lisp code

I want to attch DWG file to autocad map 3d

when I run code it was prompt this error

 

This is a error prompt:

error.jpg

 

>>Command: LLMS_ATTACH_CHAN

>>Querying from M:\LLMS_CAD\Parcels\Chanthaboury.dwg ...

>>Executing property query...done.

>>Executing location query...done.

>>Displaying queried objects...

>>611 object(s) have been queried.Unknown command "LLMS_ATTACH_CHAN". Press F1 for help.

 

This is my code:

(defun c:LLMS_ATTACH_CHAN (/ ade_cmddia_before_qry echo ortho dwgname dwg_id)

   ;store system variables
   (setq ade_cmddia_before_qry (getvar "cmddia"))
   (setq echo (getvar "CMDECHO"))
   (setq ortho (getvar "ORTHOMODE"))
   ;set system variables
   (setvar "cmddia" 0)
   (setvar "CMDECHO" 0)
   (setvar "ORTHOMODE" 1)

   (ade_projsetwscode "UTM84-48N")
   (setq dwgname "M:\\LLMS_CAD\\Parcels\\Chanthaboury.dwg")
   (if (/= nil dwgname)
       (progn
      (setq dwg_id (ade_dsattach dwgname))
                   (ade_dwgactivate dwg_id)
	    (ade_qryclear)
	    (ade_qrysetaltprop nil)
	  
                   (ade_qrydefine '("" "" "" "Location" ("all" )""))
	    (ade_qrysettype "draw")
                   (ade_qrydefine '("AND" "" "" "property" ("layer" "=" "Chanthaboury") "" ))

	    (ade_qryexecute)
                   (ade_qryclear)

                   (command "_zoom" "e" "")
        )
             (alert "Can't attach the drawing")
    )
 ;restore system variables
 (setvar "cmddia" ade_cmddia_before_qry)
 (setvar "CMDECHO" echo)
 (setvar "ORTHOMODE" ortho)
(princ)
)

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