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]
(
defun
c:Export_Block
(
/
Carpeta_dwg Nombre_dwg Punto_base sscop
)
(
setq
Carpeta_dwg
"C:/Bloques/"
)
(
setq
Nombre_dwg
(
getstring
t
"
\n
Ingresa nombre de bloque: "
)
)
(
setq
Path_dwg
(
strcat
Carpeta_dwg Nombre_dwg
".dwg"
)
)
(
setq
Punto_base
(
getpoint
"
\n
>> Indica punto base: "
)
)
(
command
"ucs"
"o"
Punto_base
""
)
(
setq
sscop
(
ssget
"_:L"
)
)
(
command
"_.-wblock"
Path_dwg
""
Punto_base sscop
""
)
(
command
"oops"
)
(
command
"ucs"
"p"
)
(
command
"base"
"0,0,0"
)
(
LM:
Open
(
strcat
Carpeta_dwg Nombre_dwg
".dwg"
)
)
(
princ
)
)
;; Abrir Archivos ---> Lee Mac
(
defun
LM:
Open
(
target
/
shell result
)
(
if
(
and
(
or
(
eq
'INT
(
type
target
)
)
(
setq
target
(
findfile
target
)
)
)
(
setq
shell
(
vla-getInterfaceObject
(
vlax-get-acad-object
)
"Shell.Application"
)
)
)
(
progn
(
setq
result
(
vl
-
catch
-
all
-
apply
'
vlax-invoke
(
list
shell '
open
target
)
)
)
(
vlax-release-object
shell
)
(
not
(
vl-catch-all-error-p
result
)
)
)
)
)
(
vl-load-com
)