AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

swap_wdm issue

6 REPLIES 6
Reply
Message 1 of 7
testsubject
303 Views, 6 Replies

swap_wdm issue

I am not sure if anyone else has noticed this and have been just dealing with it for a long time but something about this function is not acting properly. It appears to do most of the layers except the WD-Wires layer. I always have to manually do this layer.

I always select "Change to new WD_M Block, Values, Layers" and select the wd_m.dwg located here:

C:\Program Files\Autodesk\Acade 2006\Libs\jic1

This is from the command window:
_________________________________________________
PANEL:
Type "swap_pnlm" to swap and conv to new lays carried on new wd_pnlm.dwg
Type "swap_pnlm_keep" to swap but keep drawing's existing layer names
SCHEMATICS:
Type "swap_wdm" to swap and conv to new lays carried on new wdm.dwg
Type "swap_wdm_keep" to swap but keep drawing's existing layer names

Command:
Change WD-WIRENO to WIRENO, ents moved: 6
Change WD-WIRECOPY to WIRECOPY, ents moved: 0
Change WD-WIREFIXED to WIREFIXED, ents moved: 0
Change WD-TAGS to TAGS, ents moved: 9
Change WD-XREF to XREF, ents moved: 4
Change WD-DESC to DESC, ents moved: 21
Change WD-TERMS to TERMS, ents moved: 51
Change WD-XREFCHILD to XREFCHILD, ents moved: 2
Change WD-DESCCHILD to DESCCHILD, ents moved: 4
Change WD-LOC to LOC, ents moved: 9
Change WD-POS to POS, ents moved: 0
Change WD-MISC to MISC, ents moved: 113
Change WD-LINK to LINK, ents moved: 4
Change WD-SYMS to SYMS, ents moved: 18
Change WD-TAGFIXED to TAGFIXED, ents moved: 0

Processing terminal and signal arrow wire number text...
2 WIRE TERM and SIG ARROW text ents moved to layer WIREREF
_.REGEN Regenerating model.

_________________________________________________

I hope this helps,

Robert Hanrahan
ACE user since 1998


Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
6 REPLIES 6
Message 2 of 7
testsubject
in reply to: testsubject

Bumping this back to the top.

I checked into this futher and found that it applies to both 2005 and 2006.

Any word on a fix?


Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 3 of 7
Anonymous
in reply to: testsubject


Yes, you are correct. The current "swap_wdm"
utility is not set up to process wire layer differences between the
old and new versions of the WD_M block insert.

 

The utility is supplied in source code format, so,
if you'd like, you can modify your version of the utility to try to process
these wire layer names. Open up your copy of swap_wdm.lsp (its in "c:\program
files\autodesk\acade 200x\support\" folder) with a text editor (make a
back-up copy first
!).

 

Paste the part between the "**17-Aug-05" markers
(starts around line 232 in the file) and see if it works the way you're
hoping.

 

Nate.

 


size=2>                       
(princ
cnt)
                     
)
                   
)
                   
(setq ix (1+
ix))
                 
)
                 

; ** 17-Aug-05
NEHolt
                 
; Check WIRE layer
list
                 
(if (AND (nth 26 old_wd_m) (nth 26
GBL_wd_m)
                          
(/= (nth 26 old_wd_m)
"")
                          
(/= (nth 26 GBL_wd_m)
"")
                          
(/= (nth 26 old_wd_m) (nth 26
GBL_wd_m)))
                   
(progn ; Okay, WIRE layer list is different from the old list. Process
all
                          
; LINE entities and find those that are wires per old WD_M block
and
                          
; check against new layer name
list.
                     
(setq old_wd_m_wirelay_lst (nth 26 old_wd_m)) ; old wire layer
list
                     
(setq swap_wd_m_wirelay_lst (nth 26 GBL_wd_m)) ; new swaped block's wire layer
list
                     
(setq ss (ssget "_X" '((0 .
"LINE"))))
                     
(if (/= ss
nil)
                       
(progn ; this drawing has LINE entities, process each
one
                         
(princ (c:wd_msg "CFG060" nil "Wire
layers"))
                         
(princ
"\n")
                         
(setq slen (sslength
ss))
                         
(setq ix
0)
                         
(while (< ix
slen)
                           
(setq en (ssname ss ix)) ; next wire object to
process
                           
(setq ix (1+ ix)) ; increment counter for next
time
                           
(setq ed (entget en)) ; open the LINE
entity
                           
(setq existing_laynam (ace_strcase (cdr (assoc 8 ed)))) ; get its layer
name
                           
; Check if this LINE entity is on a wire layer defined on original WD_M
block
                           
(setq hit
nil)
                           
(foreach x
old_wd_m_wirelay_lst
                             
(if (AND (not hit) (wcmatch existing_laynam (ace_strcase x))) (setq hit
1))
                           
)
                           
(if
hit
                             
(progn ; this LINE entity is on a wire layer. Make sure that this layer
is
                                    
; also listed in new WD_M block. If it is not, then move this wire
to
                                    
; the first (or only) layer in the new wire layer
list.
                               
(setq hit
nil)
                               
(foreach x
swap_wd_m_wirelay_lst
                                 
(if (AND (not hit) (wcmatch existing_laynam (ace_strcase x))) (setq hit
1))
                               
)
                               
(if (not
hit)
                                 
(progn ; problem, the LINE entity is no longer on a wire layer. Move it
to
                                        
; the first layer listed in the new WD_M block's WIRELAY
list
                                   
(setq newed (subst (cons 8 (car swap_wd_m_wirelay_lst)) (assoc 8 ed)
ed))
                                   
(if
newed
                                     
(progn ; okay to update the existing LINE entity's layer
assignment
                                       
(entmod
newed)
                                       
(entupd
en)
                                       
(princ (c:wd_msg "VIS020" (list existing_laynam (car swap_wd_m_wirelay_lst)) "%1
-->
%2"))
                                       
(princ
"\n")
                 
) ) ) ) ) ) ) ) ) )
)                       

; ** 17-Aug-05
NEHolt.end                                   

               
)
               
((= blktodo
"WD_PNLM")
                 
(setq GBL_wd_pnlm
nil)
                 
(c:wd_reread_pnldwg_params)

 

Bumping this back to the
top.

I checked into this futher and found that it applies to both 2005
and 2006.

Any word on a fix?
Message 4 of 7
testsubject
in reply to: testsubject

Nate,

I am sorry it took so long to get back to you on this mod. It did not work. after reloading the swa_wdm.lsp it would not run. I kept getting

Unrecognized command:

SWAP_WDM

Just thought you should know.

Robert Hanrahan
Weigh Right Automatic Scale Co.
ACE user since 1998


Bob Hanrahan
Ace User since 1998
If this answered your question, please click on "Accept Solution"
Message 5 of 7
amigaman68
in reply to: testsubject

swap_wdm asks to browse to new block with no way to specify it, so I can make a script and i have a 750 plus project to convert.

 

 

Message 6 of 7
rhesusminus
in reply to: amigaman68

Hola Amigaman (Commodore Amiga?)

What exactly are you trying to achieve?

Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 7 of 7
amigaman68
in reply to: rhesusminus

Yes, Commodore Amiga

     I was trying to run the script with out it having me specify the location for the file, but, i didn't have my directories mapped correctly. its fixed now.

 

      Tim

 

   

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost