TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: amc.dicsac on June 13, 2016, 05:14:53 PM

Title: Change coordinates + export block
Post by: amc.dicsac on June 13, 2016, 05:14:53 PM
Hello that such I need help, I have a block in the coordinates 100,100,50 and want change when exported to 0,0,0
Title: Re: Change coordinates + export block
Post by: kdub_nz on June 13, 2016, 05:29:36 PM
What have you tried that doesn't work ??
Title: Re: Change coordinates + export block
Post by: amc.dicsac on June 13, 2016, 05:36:00 PM
Code - Auto/Visual Lisp: [Select]
  1. (defun c:Export_Block (/ Carpeta_dwg Nombre_dwg Punto_base sscop)
  2. (setq Carpeta_dwg "C:/Bloques/")        
  3. (setq Nombre_dwg (getstring t "\nIngresa nombre de bloque: "))          
  4. (setq Path_dwg (strcat Carpeta_dwg Nombre_dwg ".dwg"))                                
  5. (setq Punto_base (getpoint "\n>> Indica punto base: "))  
  6. (command "ucs" "o" Punto_base "")
  7. (setq sscop (ssget "_:L"))
  8. (command "_.-wblock" Path_dwg "" Punto_base sscop "")
  9. (command "oops")
  10. (command "ucs" "p")
  11. (command "base" "0,0,0")
  12. (LM:Open (strcat Carpeta_dwg Nombre_dwg ".dwg"))
  13. (princ))
  14.  
  15.  
  16.  
  17. ;; Abrir Archivos ---> Lee Mac
  18. (defun LM:Open ( target / shell result )
  19. (if (and (or (eq 'INT (type target))
  20.               (setq target (findfile target))
  21.             )
  22. (setq shell (vla-getInterfaceObject (vlax-get-acad-object) "Shell.Application"))
  23.         )
  24. (setq result (vl-catch-all-apply 'vlax-invoke (list shell 'open target)))
  25.               (vlax-release-object shell)
  26.               (not (vl-catch-all-error-p result))
  27.         )
  28.     )
  29. )