Need Lisp routine for DWG compatability with MS

Need Lisp routine for DWG compatability with MS

Anonymous
Not applicable
1,577 Views
11 Replies
Message 1 of 12

Need Lisp routine for DWG compatability with MS

Anonymous
Not applicable

Hi Everyone !

i have a requirement to make the autocad dwg file drawing to make it compatible opening with microstation software. for that i need to do the following everytime in  my drawing :

1. Burst all nested blocks/attribute blocks in the drawing
2. Make all associative hatches as non associative
3. Make all associative dimensions as non associative
4. Clean/Purge the drawing

If i get a combined single lisp file which does the above it would be more time saving for me instead using multiple lisp files everytime. Does anyone have a solution for this? 
Thanks in advance.

 

0 Likes
Accepted solutions (1)
1,578 Views
11 Replies
Replies (11)
Message 2 of 12

hak_vz
Advisor
Advisor

So you have separate lisp files that do that?

 

Post them here so it can be joined to one.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 12

CodeDing
Advisor
Advisor

@Anonymous ,

 

I've never used Microstation, but does it accept DXF file format? Is that a viable solution instead? Just export drawing as .dxf?

 

Best,

~DD

0 Likes
Message 4 of 12

devitg
Advisor
Advisor

@Anonymous For better understanding, and maybe get further help, please upload such sample.dwg

0 Likes
Message 5 of 12

hak_vz
Advisor
Advisor

@Anonymous Using lisp is necessary only if you use some old version of Microstation.

Consult this link about how to convert DWG to DGN directly in Microstation.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 6 of 12

3wood
Advisor
Advisor
Accepted solution

Following codes can do all 4 tasks in one go.

You need download EXPLODEALL and get a free registration though. Or replace it with other equivalent codes to do task No. 1. 

(defun C:DWG2MS (/ n1 ss-h)
  (explodeall  (ssget "x"))
  (setq n1 0
	ss-h (ssget "x" '((0 . "HATCH"))))
  (repeat (sslength ss-h)
    (command "._-HATCHEDIT" (ssname ss-h n1) "Disassociate")
    (setq n1 (1+ n1))
    )
  (command "._DIMDISASSOCIATE" "all" "")
  (command "._-PURGE" "all" "*" "N")
  )

 

0 Likes
Message 7 of 12

Anonymous
Not applicable

Hi@3wood 

Thanks for your reply. i will check this routine. for task 1 burst option i found nburst in the below link from Leemac. http://www.lee-mac.com/upgradedburst.html Can this be substituted in place of explode all.

How this can be integrated with your code.

Thanks again!

 

0 Likes
Message 8 of 12

Anonymous
Not applicable

Hi @hak_vz 

Thanks for your reply!

I will checkout the link which you have given .Thanks a lot!.

 

0 Likes
Message 9 of 12

Anonymous
Not applicable

Hello @CodeDing 

I am also new to Microstation. i will check with dxf option along with the above requirements. in my requirements it was said that the version of autocad shall be in 2010 or 2013 for importing in microstation. 

Thanks for your suggestion.

0 Likes
Message 10 of 12

3wood
Advisor
Advisor

You can try following code then.

(defun c:DWG2MS (/ n1 ss1 ss2)
  ; (explodeall  (ssget "x"))
  (if  (setq ss1 (ssget "_X" '((0 . "INSERT"))))
    (progn
      (setq pfst (getvar 'PICKFIRST))
      (setvar 'PICKFIRST 1)
      (sssetfirst nil ss1)
      (LM:burst ss1)
      )
    )
  (setq n1 0
	ss2 (ssget "x" '((0 . "HATCH"))))
  (if ss2
    (repeat (sslength ss2)
      (command "._-HATCHEDIT" (ssname ss2 n1) "Disassociate")
      (setq n1 (1+ n1))
      )
    )
  (command "._DIMDISASSOCIATE" "all" "")
  (command "._-PURGE" "all" "*" "N")
  )

 

0 Likes
Message 11 of 12

Anonymous
Not applicable

Hi @3wood 

Thanks for your reply..

When i tried the code. in the command prompt it says

; error: no function definition: LM:BURST

Thanks. 

0 Likes
Message 12 of 12

hak_vz
Advisor
Advisor

@Anonymous 

 

You can download Lee Mac's LM:burst here 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes