Jump to content

HELP FOR EXPLODE BIND


hosyn

Recommended Posts

Hello guys

im gonna to make code for selecting  external block in my drawing and explode it.

please any command and idea to help this.

Link to comment
Share on other sites

hi marko

I don know how i can appreciate of your helping, that s  great what i need. one more qustion:: 

the command lisp ask us open window in cuerrent path or spescifed pass defined in code lisp.

 something like this :

(defun c:blkinsexp ( / fn )
  (setq fn (getfiled "\nSelect block DWG file..." "\\" "dwg" 16))
(setq pathinsert  getstring "your external block in the current or in default path y/n")
(
if y ---->> open window in current path
   n ---->> open window in d://my ex block//
)
  (vl-cmdf "_.-INSERT" (strcat "*" fn))
  (while (< 0 (getvar 'cmdactive))
  (vl-cmdf "\\")
  )
  (princ)
)

I have modified the above to ::

(defun c:blkinsexp ( / fn )
	  (initget 1 "Y N") ; 1 = no null input
      (setq hide (getkword "\nCURRENTLY? [Y/N] ? <Y>")) 	;Get the input

   (if
   (= hide "Y") ;If the user has entered the required key "Y"
   (setq e-path (getvar "dwgprefix"))
   (setq fn (getfiled "\nSelect block DWG file..." e-path "dwg" 16)))
	  
   ( if
   (= hide "N")	 	
   (setq fn (getfiled "\nSelect block DWG file..." "E://99/ "dwg" 16)))

	 (vl-cmdf "_.-INSERT" (strcat "*" fn))
     (while (< 0 (getvar 'cmdactive))
     (vl-cmdf "\\")
	 )
  (princ)
)

and i get the following error:

Command:
error: malformed string on input
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.
Command:

 

 

Edited by hosyn
Link to comment
Share on other sites

You might also like to check out Lee Macs Upgraded Burst lisp.

I've never used it, but I am sure there are those who WILL find it very helpful.

Thanks Lee!  :beer:

 

Link to comment
Share on other sites

hi marko

I don know how i can appreciate of your helping, that s  great what i need. one more qustion:: 

the command lisp ask us open window in cuerrent path or spescifed pass defined in code lisp.

 something like this :

(defun c:blkinsexp ( / fn )
  (setq fn (getfiled "\nSelect block DWG file..." "\\" "dwg" 16))
(setq pathinsert  getstring "your external block in the current or in default path y/n")
(
if y ---->> open window in current path
   n ---->> open window in d://my ex block//
)
  (vl-cmdf "_.-INSERT" (strcat "*" fn))
  (while (< 0 (getvar 'cmdactive))
  (vl-cmdf "\\")
  )
  (princ)
)

I have modified the above to ::

(defun c:blkinsexp ( / fn )
	  (initget 1 "Y N") ; 1 = no null input
      (setq hide (getkword "\nCURRENTLY? [Y/N] ? <Y>")) 	;Get the input

   (if
   (= hide "Y") ;If the user has entered the required key "Y"
   (setq e-path (getvar "dwgprefix"))
   (setq fn (getfiled "\nSelect block DWG file..." e-path "dwg" 16)))
	  
   ( if
   (= hide "N")	 	
   (setq fn (getfiled "\nSelect block DWG file..." "E://99/ "dwg" 16)))

	 (vl-cmdf "_.-INSERT" (strcat "*" fn))
     (while (< 0 (getvar 'cmdactive))
     (vl-cmdf "\\")
	 )
  (princ)
)

and i get the following error:

Command:
error: malformed string on input
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.
Command:
Link to comment
Share on other sites

Try this mod...

 

(defun c:blkinsexp ( / fn hide path )

  (initget "Y N")
  (setq hide (getkword "\nCURRENTLY? [Y/N] ? <Y> : "))
  (if (null hide)
    (setq hide "Y")
  )

  (cond
    ( (= hide "Y")
      (setq fn (getfiled "\nSelect block DWG file..." (getvar 'dwgprefix) "dwg" 16))
    )
    ( (= hide "N")
      (if (not (vl-file-directory-p (setq path "E:\\99\\")))
        (if (vl-file-directory-p "E:\\")
          (vl-mkdir (setq path "E:\\99\\"))
          (if (not (vl-file-directory-p (setq path "C:\\99\\")))
            (vl-mkdir (setq path "C:\\99\\"))
          )
        )
      )
      (setq fn (getfiled "\nSelect block DWG file..." path "dwg" 16))
    )
  )

  (vl-cmdf "_.-INSERT" (strcat "*" fn))
  (while (< 0 (getvar 'cmdactive))
    (vl-cmdf "\\")
  )
  (princ)
)

 

Edited by marko_ribar
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...