-DWGUNITS

-DWGUNITS

Setsquare
Participant Participant
4,526 Views
16 Replies
Message 1 of 17

-DWGUNITS

Setsquare
Participant
Participant

Could the -DWGUNITS command please be clarified.

 

Does AutoCAD have nil values for the settings within DWGUNITS unless/until this command has been evoked?

 

Have had several situations when:

post "cut"/wblock data out from a main ref drawing with block symbology, then when the block subsequently needs to be redefined in the "cut" dwg, the redefined block is then inserting to an incorrect scale.

 

Upon investigating; INSUNITS and UNITS are set to metres in the main ref dwg, the "cut" dwg, AND the original and redefined block(s). Similarly the source and target scale are to metres.

 

However, when interrogating the -DWGUNITS values, the value in the ref AND the block dwgs are <metres>, yet the "cut" drawing is <millimetres>

Unsure as to the platform origin of the block drawings. So questions are:

 

If acadiso.dwt is used as common base for all dwgs & used as the default template file for QNEW, does the Autodesk platform used determine the "default" -DWGUNITS values assigned?

 

ie

acadiso.dwt [UNITS set to metres] opened in Civils3D default to "metres" (ie as per UNITS & INSUNITS values)

same acadiso.dwt opened in AutoCAD Map 3D default to "millimetres"?

 

Some client drawings are created using either Civils3D, Map3D, or vanilla AutoCAD. I am operating Map3D

 

Looks as if I need to run a lisp to set -DWGUNITS to millimetres to solve this, but need to know how to avoid this in the first place.

 

 

0 Likes
Accepted solutions (1)
4,527 Views
16 Replies
Replies (16)
Message 2 of 17

ChicagoLooper
Mentor
Mentor

Yes, DWGUNITS can be unitless but.......

 

if you are dealing with georeferenced objects or images and want to insert them properly, then your DWGUNITS will be (must be) either feet or meters because the northing/easting coordinates have units, e.g. feet or meters. There's no such thing as a 'unitless' coordinate system.

 

And Bing aerial imagery won't appear if you fail to assign a Projected Coordinate System to your drawing. Your drawing will adopt (or inherit) the units of the Coordinate System. for your drawing units. 

 

Depending on how you ADD linework and images to your drawing, you may or may not, need to rescale and reposition them.

 

 

  

 

 

Chicagolooper

EESignature

0 Likes
Message 3 of 17

Setsquare
Participant
Participant

Thanks for your input.

I fully understand that any CRS needs to have units defined. UNITS/INSUNITS/INSUNITSDEFSOURCE and INSUNITSDEFTARGET are all unambiguous in how they are used.

My lack of understanding is HOW AutoCAD has embedded and amends the -DWGUNITS command variables.

Our source dwgs may come from various Autodesk platforms and it is becoming apparent that issues seem to arise when Civils3D source dwgs are then worked on in either Map3D or vanilla AC. But generally, there appears to be no logic in how AutoCAD handles -DWGUNITS. This is not helped with the severe lack of definitive documentation on the subject.

For a simple example; we have been finding that when wblock is utilised, the DWGUNITS defaults to <3> millimetres in the new dwg file. This despite UNITS/INSUNITS remaining at metres! This can go un-noticed until any blocks (with -DWGUNITS variable set to metres) need to be reinserted/redefined into the dwg. 

0 Likes
Message 4 of 17

ChicagoLooper
Mentor
Mentor

@Setsquare wrote

<<...it is becoming apparent that issues seem to arise when Civils3D source dwgs are then worked on in either Map3D or vanilla AC. ...>

 

Can you upload your 'original' drawing (not a copy)) so the drawing can be evaluated? The drawing units might have been modified so the original dwgunits must be analyzed. Moving from objects from plain vanilla AutoCAD to Map3D, and vice versa, might require you to consider a change of the dwgunts.

 

Can you also upload the block in question. Not all blocks are created equal. For example, some are annotative while some aren't. Some are created by experienced users while others are created by dabblers. Some are created using units of inches, others use millimeters, while others are 'unitless' so how your specific drawing interacts with a specific block can vary from drawing-to-drawing and from block-to-block.  

 

Using blocks created by others may introduce variables that may not be factored into your insertion process. Different blocks have different authors so each block might need to be evaluated separately. Just because two blocks comes from the same drawing doesn't mean those two blocks will behave the same. The firm sending you that drawing may have created one block and inherited the other.

 

You may want to create new blocks, not copies, using those blocks, the ones created by others, as inspiration when authoring brand new blocks that you compile for your firm's Block Library. 

 

If you only look at your drawing settings without also considering the individual block you're inserting, then you might have issues. 

 

Chicagolooper

EESignature

0 Likes
Message 5 of 17

Setsquare
Participant
Participant
Standby for me to upload the various drawings.

When I interrogate all of the elements in question & as I previously stated:
Ref data file & symbol block dwgs - UNINTS/INSUNITS/DWGUNITS are ALL metres
As soon as the Ref data file is exported using wblock (or "Cutting" the data out to specific geog extents) the resulting dwg file(s) have DWGUNITS reverting to millimetres (UNITS/INSUNITS are still metres)

Q1 - what is AutoCAD defaulting the DWGUNITS to when using acadiso.dwt? If this differs per AutoCAD platform then what is it per platform?
Q2 - are DWGUNITS unit value only populated when the DWGUNITS command is executed - if not, revert to Q1
Q3 - why is AutoCAD defaulting DWGUNITS to millimetres when all components prior to wblock command has DWGUNITS to metres?

0 Likes
Message 6 of 17

Setsquare
Participant
Participant

Apologies for the delay

Please find files attached. Hope that they make sense.

 

Sequences of work:

1 B_MapImport.dwg    data imported [MapImport] into new dwg based on acadiso_UNITS-INSUNITS-m_DWGUNITS-m.dwt [set as QNEW template]

2 B_MapImport_Symbology_Applied.dwg    IOGP1043 Benthic Sample_ATT.dwg applied to imported points

3 B_MapImport_Symbology_Applied_WBlock_Panel_002a.dwg    geographic area extracted from 2 using wblock cmd

 

when revised block dwg IOGP1043 Benthic Sample_ATT_Revised.dwg  is reinserted into B_MapImport_Symbology_Applied_WBlock_Panel_002a.dwg to redefine the block, block scaling is unexpectedly incorrect due to DWGUNITS reverting to millimetres

 

Panels_ECC_AL_5k.dwg - ref dwg used to "CUT" data using third party bolt on which results in B_MapImport_Symbology_Applied_CUT_Panel_002a.dwg [again, DWGUNITS reverts to millimetres]

 

Simplistically, this shows that

ALL component dwgs (incl .dwt) need to have the same DWGUNITS value

wblock must use a different .dwt OR defaults DWGUNITS to millimetres when executing the cmd regardless of UNITS/INSUNITS/INSUNITSDEFSOURCE and INSUNITSDEFTARGET in parent dwg

 

@Setsquare - the moderation team has removed your file per your request.

 

0 Likes
Message 7 of 17

Setsquare
Participant
Participant

supporting files

0 Likes
Message 8 of 17

Setsquare
Participant
Participant

Additional information added to discussion incl sample files

Hope that these assist

0 Likes
Message 9 of 17

ChicagoLooper
Mentor
Mentor

@Setsquare 

Don't take this the wrong way but you're oversimplifying it. You're looking for a one-size-fits-all formula that'll solve your issue.

 

Forget the block at this stage. You need to establish an appropriate coordinate system. If the SENDER of your 'shared drawings' is using a coordinate system then you'll need to use one too. Otherwise your drawing will be plain vanilla AutoCAD-ish and his will be geospatially accurate.

 

  1. Your drawing named B_MapImport.dwg shows points. So how did those points get added to the drawing? From a spreadsheet? Can you upload that spreadsheet? They didn't just magically appear in modelspace. Did they?
  2. Your dwgunits will be related to your drawing's geospatial projection--and that can't be definitively determined. What is the name of the nearest city? If you can't disclose the city then your dwgunits will be pure guess work, not fact.    

Chicagolooper

EESignature

0 Likes
Message 10 of 17

Setsquare
Participant
Participant

Cheers for your input. It is truly appreciated.

Points are imported from a shape file with NO CRS applied. DWG file as you have seen also does not have a CRS assigned.

Points are correct as per their original quoted coordinates.

The questions still remains - where does ACAD invoke DWGUNITS, What is the default DWGUNITS value for acadiso.dwt, why does AutoCAD revert the DWGUNITS to millimetres when wblock is used.

If users have proactively set the DWGUNITS to match the project units of measurement so that all variables are the same (ie metres), then there becomes an issue when drawing elements are "cut" from a dwg using wblock or similar.

0 Likes
Message 11 of 17

Pointdump
Consultant
Consultant

Hi Clark,
"where does ACAD invoke DWGUNITS"
I don't understand what you're asking here.
"What is the default DWGUNITS value for acadiso.dwt"
Meters.
"why does AutoCAD revert the DWGUNITS to millimetres when wblock is used."
All Blocks have defined Block Units, which you can see in Properties. And note that AutoCAD considers Model Space to be a Block.
"If users have proactively set the DWGUNITS to match the project units of measurement so that all variables are the same (ie metres), then there becomes an issue when drawing elements are "cut" from a dwg using wblock or similar."
You totally lost me here. Can you expand on this?
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
0 Likes
Message 12 of 17

ChicagoLooper
Mentor
Mentor

@Setsquare wrote

<<....Points are imported from a shape file with NO CRS applied. DWG file as you have seen also does not have a CRS assigned....>>

 

Would it be possible to upload the shapefile itself? Upload the components with extensions shp, shx, dbf, and prj. Also upload all other extensions that accompany those components. Upload all files.

 

BTW, the statement 'as you have seen also does not have a CRS assigned' doesn't necessarily mean the shapefile doesn't have a projection (CRS). All it means is the dwg file which the imported points landed in doesn't have an assigned CS.

 

There are always, without exception, two coordinate systems: (a) the native CS of the shapefile and (b) the coordinate system of the dwg which will be used to host, or display, the shapefile. It doesn't matter if the shapefile is added to a drawing using a Feature Data Object connection (FDO connection) or whether the points are imported using the MAPIMPORT command. A drawing file, one with dwg extension, will host or accept the point shapefile and that host file must have (should have) an assigned CS.

 

If you are not cognizant of how two coordinate systems can function side-by-side and in geospatial harmony then you'll have issues. 

 

Chicagolooper

EESignature

0 Likes
Message 13 of 17

O_Eckmann
Mentor
Mentor
Accepted solution

Hi @Pointdump ,

 

Command isn't DWGUNITS, but  -DWGUNITS (see character minus).

First time you launch this command, module AEC Bas is loading and defines AEC units which differ from AutoCAD units.

By default these AEC units are in millimeters option 3, instead of reading current units of drawing to set same units.

When you reenter correct units (option 6 for meter) with this command, and make a WBLOC of a part of your drawing, new created drawing is set to millimeters for ACE units istead of using current AEC units.

These AEC units in millimeter generate error for example to measure area.

 

I join a DWG (EPSG 3949, legal system for France RGF93.CC49) with only a rectangle around 3nd stair of Eiffel Tower.

Try to measure aera of this rectangle with AREA command : first 2 points are OK, but you can't clic another point, due to message "Points are not coplanar".

Now enter -DWGUNITS and set Meter (option 6), and set 2 and 3 for units, plus _YES, _YES and _NO for scaling actual drawing. Now measure area of rectangle => it's possible.

 

 

Olivier Eckmann

EESignature

Message 14 of 17

Setsquare
Participant
Participant

Thanks again for your input

However this is not a CRS issue

The issues are down the line of using a shape file. The points can equally be imported into a dwg from an ascii data file which has no CRS defined.

0 Likes
Message 15 of 17

Setsquare
Participant
Participant

Thank you for confirming what we have been experiencing. We are at last getting somewhere.

So Autodesk really need to document -DWGUNITS(!!) better & de-bug reverting -DWGUNITS to millimetres retaining the -DWGUNITS settings from the parent dwg when wblock is used.

Perhaps someone from Autodesk would like to respond(?)

 

Message 16 of 17

Setsquare
Participant
Participant

Hi Dave

Thanks for your input.

I think subsequent posts have resolved the issue as much as can be expected.

 

Thanks to all for your input & assistance

0 Likes
Message 17 of 17

Pointdump
Consultant
Consultant

Clark,
Time to open a Support Ticket.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
0 Likes