TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: domenicomaria on March 31, 2023, 04:03:10 AM

Title: wblock in a previous version
Post by: domenicomaria on March 31, 2023, 04:03:10 AM
Is it possible to create DWGs in a previous version with the wblock command?

For example I use the Acad 2022 version
and I want to create DWGs in the ACAD 2000 version
with WBLOCK ...

... is it possible?
Title: Re: wblock in a previous version
Post by: ribarm on March 31, 2023, 04:15:22 AM
I think it's not possible...

Instead 2 steps :

1. WBLOCK
2. OPEN -> SAVEAS -> A2000 format
Title: Re: wblock in a previous version
Post by: domenicomaria on March 31, 2023, 05:11:31 AM
 :-(
Title: Re: wblock in a previous version
Post by: Marc'Antonio Alessi on March 31, 2023, 05:21:21 AM
For Acad >= 2007 look for vla-Put-SaveAsType
Title: Re: wblock in a previous version
Post by: domenicomaria on March 31, 2023, 06:37:25 AM
@Marco

I don't want SAVEAS . . .
I want that WBLOCK creates a DWG in a previous version

I add
(setenv "DefaultFormatForSave" "12")
before WBLOCK
but the final DWG format, is the current version
and not ACAD2000 ("DefaultFormatForSave" = "12")
Title: Re: wblock in a previous version
Post by: domenicomaria on March 31, 2023, 06:41:58 AM
And before use WBLOCK, I added
(vla-put-saveastype (vla-get-opensave (vla-get-preferences (vlax-get-acad-object) ) ) ac2000_dwg )
instead of
(setenv "DefaultFormatForSave" "12")
. . .
but nothing is changed !
Title: Re: wblock in a previous version
Post by: Marc'Antonio Alessi on March 31, 2023, 10:45:17 AM
(vla-put-saveastype (vla-get-opensave (vla-get-preferences (vlax-get-acad-object) ) ) ac2000_dwg )
Works... tested in AutoCAD 2013
Title: Re: wblock in a previous version
Post by: domenicomaria on March 31, 2023, 10:51:31 AM
thank you Marco

I will give it a try
(again)
... monday !

ciao
Title: Re: wblock in a previous version
Post by: domenicomaria on April 03, 2023, 03:58:50 AM
(vla-put-saveastype (vla-get-opensave (vla-get-preferences (vlax-get-acad-object) ) ) ac2000_dwg )
Works... tested in AutoCAD 2013

1
Code - Auto/Visual Lisp: [Select]

2
Code - Auto/Visual Lisp: [Select]
  1. (defun :VLA-WBLOCK (ss full-dwg-file-name / active-doc )
  2.    (:SS-MAKE-PREVIOUS- ss)
  3.    (and
  4.       ss
  5.       full-dwg-file-name
  6.       (setq active-doc (:ACTIVE-DOCUMENT) )
  7.       (not
  8.          (vl-catch-all-error-p
  9.               (vl-catch-all-apply 'vla-WBlock
  10.                (list active-doc full-dwg-file-name (vla-get-ActiveSelectionSet active-doc) )
  11.               )
  12.          )
  13.       )
  14.    )
  15. )

3
Code - Auto/Visual Lisp: [Select]
  1. LM:DWGVERSION

Marco, it seems that it does not work !
Title: Re: wblock in a previous version
Post by: Marc'Antonio Alessi on April 03, 2023, 04:23:09 AM
Have you tried wblock command?
Title: Re: wblock in a previous version
Post by: domenicomaria on April 03, 2023, 06:55:02 AM
Have you tried wblock command?

Yes.

With wblock command, it works !

Thank you.
Title: Re: wblock in a previous version
Post by: Marc'Antonio Alessi on April 03, 2023, 08:23:47 AM
Have you tried wblock command?

Yes.

With wblock command, it works !

Thank you.
Your question: Is it possible to create DWGs in a previous version with the wblock command?
Title: Re: wblock in a previous version
Post by: domenicomaria on April 03, 2023, 08:35:14 AM
Yes!

"Is it possible to create DWGs in a previous version with the wblock command?"

this is the right way to express the concept!