Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Redefining a block in multiple files via OBJECTDBX Wrapper
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Redefining a block in multiple files via OBJECTDBX Wrapper (Read 2593 times)
0 Members and 1 Guest are viewing this topic.
MSTG007
Gator
Posts: 2601
I can't remeber what I already asked! I need help!
Redefining a block in multiple files via OBJECTDBX Wrapper
«
on:
April 11, 2015, 09:07:16 AM »
Lee ad awhile ago showed me an awesome way to do some layer management stuff via this.
http://www.theswamp.org/index.php?topic=47376.msg524151#msg524151
I was wondering using his same setup how to change it to redefine 1 block name in mulitple dwgs.
Thanks!
Logged
Civil3D 2020
ttray33y
Mosquito
Posts: 1
Re: Redefining a block in multiple files via OBJECTDBX Wrapper
«
Reply #1 on:
June 14, 2015, 11:26:33 PM »
in my own understanding. ObjectDBX wrapper cannot do that.
Code:
[Select]
http://lee-mac.com/odbxbase.html
Logged
Lee Mac
Seagull
Posts: 12914
London, England
WWW
Re: Redefining a block in multiple files via OBJECTDBX Wrapper
«
Reply #2 on:
June 15, 2015, 04:10:10 AM »
You could try the following (untested!):
Code - Auto/Visual Lisp:
[Select]
(
defun
c:batchredef
(
/
blk dwg
)
(
while
(
not
(
or
(
=
""
(
setq
blk
(
getstring
t
"
\n
Specify block name to redefine: "
)
)
)
(
setq
dwg
(
findfile
(
strcat
blk
".dwg"
)
)
)
)
)
(
princ
(
strcat
"
\n
File
\"
"
blk
".dwg
\"
not found."
)
)
)
(
if
dwg
(
LM:odbx
(
function
(
lambda
(
doc
)
(
if
(
not
(
vl-catch-all-error-p
(
vl
-
catch
-
all
-
apply
'
vla-item
(
list
(
vla-get-blocks
doc
)
blk
)
)
)
)
(
vla-delete
(
vla-insertblock
(
vla-get-modelspace
doc
)
(
vlax-3D-point
0
0
)
dwg
1.0
1.0
1.0
0.0
)
)
)
)
)
nil
t
)
)
(
princ
)
)
EDIT: On testing the above, this method does not appear to be successful.
«
Last Edit: June 15, 2015, 04:59:16 AM by Lee Mac
»
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Redefining a block in multiple files via OBJECTDBX Wrapper