Author Topic: insertunits  (Read 2655 times)

0 Members and 1 Guest are viewing this topic.

Humbertogo

  • Guest
insertunits
« on: September 19, 2006, 02:30:11 PM »
Is there  a way to know in what units a block is drawing before insert the as block?

Thanks

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: insertunits
« Reply #1 on: September 19, 2006, 03:01:40 PM »
What is your default?  I'm assuming your wanting to know b/c its someone elses block?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Humbertogo

  • Guest
Re: insertunits
« Reply #2 on: September 19, 2006, 03:23:20 PM »
i use autocad mechanical 2006
and use the AMLIBRARY to insert a block from the library
but we drawing in inches as mm.
for example
I work in a mm drawing and insert a block with the AMLIBRARY
even the insertunits is set to 4 Millimeters the block is insert 1:1
and not scale 25.4

if i use the insert command the block will scale automatic

i can Handel  this with a event

Private Sub AcadDocument_ObjectAdded(ByVal Object As Object)
' On Error GoTo ERR_Clear
Dim objBlock As AcadBlockReference
If TypeOf Object Is AcadBlockReference Then
Set objBlock = Object

'
but not all blocks are drawing in inches some of then are drawing in mm
i need to know in witch units they are drawing to specific the scale

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: insertunits
« Reply #3 on: September 19, 2006, 03:33:16 PM »
wow, that hurts my brain just thinking about it.  I'll look and see if there are any ways to tell what it is drawn too.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bryco

  • Water Moccasin
  • Posts: 1882
Re: insertunits
« Reply #4 on: September 19, 2006, 04:08:37 PM »
Units may help you, I'm not sure, perhaps you can insert the blockref
then check the block.units then rescale the block if reqd.
Dim B As IAcadBlock3

Debug.Print B.units

Humbertogo

  • Guest
Re: insertunits
« Reply #5 on: September 20, 2006, 08:28:31 AM »
unfortunately Debug.Print B.units is always 0

Bryco

  • Water Moccasin
  • Posts: 1882
Re: insertunits
« Reply #6 on: September 20, 2006, 01:44:08 PM »
I should have listened to CmdrDuh-it hurts your brain.
So I've found no way, other than opening the dwg to find the units.
However.
Using a metric dwg and inserting a unitless inches dwg.
Using vba, it seemed like whatever combo of  InsUnits , INSUNITSDEFSOURCE, INSUNITSDEFTARGET I set first,the blockref came in at the 1,1,1 scale I had set

Next trying insert with INSUNITS=0    DEFSOURCE=4   DEFTARGET=4
In the properties window the blockunit says inches unit factor 1 and x is 25.4
 INSUNITS=0    DEFSOURCE=1   DEFTARGET=4   the same
 INSUNITS=0    DEFSOURCE=4   DEFTARGET=1 bad for both  inches x is 1 and mm x is 0.0394

As help says the INSUNITSDEFSOURCE and  INSUNITSDEFTARGET only play when insunits =0
When using 4 for insunits I had good results on unitless drawings.
Interestingly the properties window now says inches unit factor 25.4 and x is 1

I don't know how to set a  drawing from unitless.

Bryco

  • Water Moccasin
  • Posts: 1882
Re: insertunits
« Reply #7 on: September 20, 2006, 02:22:03 PM »
I'll have another go at this.
The units property reflects the insunits value of the drawing.
A standard inches dwg will have
INSUNITS=1    DEFSOURCE=1   DEFTARGET=1
A standard mm dwg will have
INSUNITS=4    DEFSOURCE=1   DEFTARGET=1 (Cad blunder, 4,4,4 is better)
To create a truely unitless drawing you need
INSUNITS=0    DEFSOURCE=0   DEFTARGET=0
as a mm dwg with the INSUNITS set to 0 will still have
DEFSOURCE=1   DEFTARGET=1 and so will insert like an inch drawing.

So Humbertogo you may need to change all the unitless dwgs to their correct setting.
Unitless blocks are handy for ???? unit circles of 1 unit, confusing people, making refernce blocks.