Author Topic: Documentation / Explanation of "-dwgunits"  (Read 6851 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 650
Documentation / Explanation of "-dwgunits"
« on: April 23, 2018, 06:55:23 AM »
The command "-dwgunits" seem to be one of the great mysteries in AutoCAD.

AutoCAD 2016 finds 7 topics in Support and 2 solved topics in Forums
AutoCAD 2017 finds also 7 and 2
AutoCAD 2018 finds 2 and 1
AutoCAD 2019 finds 0 and 0

Does someone know a comprehensive documentation of this command for current releases? Also including the impact on the scaling in plot command of Layouts?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ChrisCarlson

  • Guest
Re: Documentation / Explanation of "-dwgunits"
« Reply #1 on: April 23, 2018, 08:26:44 AM »
I'm not sure what your question is or the confusion over dwgunits.

pendean

  • Mosquito
  • Posts: 20
  • "I am not a number, I am a free man"
Re: Documentation / Explanation of "-dwgunits"
« Reply #2 on: April 23, 2018, 09:08:12 AM »
Does someone know a comprehensive documentation of this command for current releases? Also including the impact on the scaling in plot command of Layouts?
The command is to address UNITS settings for modelspace content only, it has nothing to do with layouts except as it affects viewport(s) content.
What exactly are you trying to do? explain in more detail.

FWIW DWGUNITS pretty much self-explains itself as you read the prompts for each category, but if you want more detailed explanations the web is full of content written all about it, the command's function have never changed since it was first introduced
https://thesourcecad.com/how-to-change-units-of-existing-drawing-in-autocad/
https://www.cad-notes.com/convert-autocad-units-using-dwgunits/
https://www.youtube.com/watch?v=IkbBkVYM7hg
and more if these do not satisfy your cravings.

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: Documentation / Explanation of "-dwgunits"
« Reply #3 on: April 23, 2018, 03:11:48 PM »
It is a terrible command, once set in a wrong way and you have a lot of troubles. From origin it came from LDD or earlier software I think, and it was used the way INSUNITS works now in AutoCAD. But the -DWGUNITS overrule the AutoCAD vars, unless you set the right options. The INSUNITS of AutoCAD will scale blocks and maintain the original size, but the -DWGUNITS will scale the contents of the block and then set the block scale to 1. It corrupts your blocks.


I'll advice to set No to block scaling and Yes to match the AutoCAD Settings. That way you leave the block scaling and units settings to AutoCAD.


It is saved in each drawing.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Documentation / Explanation of "-dwgunits"
« Reply #4 on: April 23, 2018, 04:34:53 PM »
I think dubbing it "terrible" is generous -- it's horrible and insidious like a v****** disease.

Code: [Select]
(defun c:KillItWithFire ( )
    ;;  Code is provided as-is with no expressed or implied warranty
    ;;  for any particular use. User must assure his or herself of the
    ;;  applicability of any portion of this code for their use and
    ;;  accepts all direct and indirect consequences resulting from
    ;;  said use.
    (   (lambda ( nop doc / dic name1 name2 )
            (vl-catch-all-apply 'eval
               '((progn
                    (vla-remove
                        (setq dic
                            (vla-item
                                (vla-get-dictionaries doc)
                                (setq name1 "AEC_VARS")
                            )
                        )
                        (setq name2 "AEC_VARS_DWG_SETUP")
                    )
                    (princ (strcat "\nDeleted " name2 "."))
                ))       
            )
            (vl-catch-all-apply 'eval
               '((progn   
                    (vla-delete dic)
                    (princ (strcat "\nDeleted " name1 "."))
                ))
            )
            (princ)
        )
        (vl-load-com)
        (vla-get-activedocument (vlax-get-acad-object))
    )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Peter2

  • Swamp Rat
  • Posts: 650
Re: Documentation / Explanation of "-dwgunits"
« Reply #5 on: April 24, 2018, 02:57:54 AM »
For me, the plot settings and modifications in layout are interesting.
Also, the changing appearance of units in Civil-Menu.

new drawing, units=meter, Civil-Units=meter    -> Go to Layout, start Plot dialogue: The scale is set to: "1:1000; 1=1". Changing of the scale keeps the relation "1000", eg: "1:500; 1=0.5"

-dwgunits: select centimeter (4); scale model, don't scale layout

units=centimeter, Civil-Units=centimeter    -> Go to Layout, start Plot dialogue: The scale is set to: "1:10; 1=1". Changing of the scale keeps the relation "10" (this reflects the factor 100 from meter to centimeter)

-dwgunits: select milliimeter (3); scale model, don't scale layout

units=millimeter, Civil-Units=millimeter    -> Go to Layout, start Plot dialogue: The scale is set to: "1:1; 1=1". Changing of the scale keeps the relation "1"

I would like to know which value (variable) is used by the plot dialogue to find the settings "1:1000 / 1:100 / 1:1"

Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

steve.carson

  • Newt
  • Posts: 108
Re: Documentation / Explanation of "-dwgunits"
« Reply #6 on: April 24, 2018, 12:17:51 PM »

I would like to know which value (variable) is used by the plot dialogue to find the settings "1:1000 / 1:100 / 1:1"


That comes from the Scale List (scalelistedit command).

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Documentation / Explanation of "-dwgunits"
« Reply #7 on: April 24, 2018, 12:32:52 PM »
Maybe put this in your startup :)
Code: [Select]
(command "_.undefine" "-dwgunits")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Peter2

  • Swamp Rat
  • Posts: 650
Re: Documentation / Explanation of "-dwgunits"
« Reply #8 on: April 25, 2018, 04:12:16 AM »
That comes from the Scale List (scalelistedit command).
Hi Steve

I mean this - you see the plot-menus in Layout, dwgunits from left to right are "meter / centimeter / millimeter"

If you select a value from the "scale-combolist", the values below "x mm = y units" is modified.
And for example - 1:1000 shows different units

Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

steve.carson

  • Newt
  • Posts: 108
Re: Documentation / Explanation of "-dwgunits"
« Reply #9 on: April 25, 2018, 11:26:18 AM »
That is strange. I tested it on my 2018 and changing the units and/or -dwgunits has no affect on what is shown there. Only the scale list seems to change it.

Is your scalelist being changed when you change the units?

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: Documentation / Explanation of "-dwgunits"
« Reply #10 on: April 26, 2018, 02:54:40 AM »
That happens when you don't match the units with AutoCAD. This function will scale everything if you change the units, including the Scale List items.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Peter2

  • Swamp Rat
  • Posts: 650
Re: Documentation / Explanation of "-dwgunits"
« Reply #11 on: April 26, 2018, 03:16:40 AM »
...Is your scalelist being changed when you change the units?
.... This function will scale everything if you change the units, including the Scale List items.
My scalelist does not change the names of the entries (1:1 ; 1:50; ..), but the value behind it as shown above: 1:1 is 1=1 (for mm) or 1=0.001 (for meters)

That happens when you don't match the units with AutoCAD. ...
This is not clear for me too. I'm missing a fine description of the relation between dwgunits / units / insunits / 2 x insunitsdef... / plotunits / scalelistvalues .

I think I will test the Autocad-support and report here later.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: Documentation / Explanation of "-dwgunits"
« Reply #12 on: April 26, 2018, 03:56:26 AM »
If I set -dwgunits to a different unit and also not match the drawing units, the function will change everything in the drawing to the new units. the scale list items are updated, not the name but the scale itself. Before the Scale "1:1" was set as 1 drawing units is 1 paper units, after changing -dwgunits the Scale "1:1" suddenly is set to 1 drawing units is 0.1 paper units.


Therefor I advised to set -dwgunits to NOT scale symbols on insert and YES to match units. Then it will respect the drawing settings and the insertion and scale related stuff is done by AutoCAD, as it should be.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.