Author Topic: INSBASE setting  (Read 3677 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
INSBASE setting
« on: July 21, 2005, 01:56:18 PM »
If a drawing has a INSBASE setting other than 0,0,0 and some layers are truned off or forzen the setting when changed to 0,0,0 moves only the selectable items shown. If you thaw all or turn on all those items contained within those layers do not move or are affected by the setting change. Any ideas where a routine could be established to set INSBASE to 0,0,0.....turn or thaw all the layers...then run the INSBASE variable and then set the layers back to the orginal state......does this make sense....


 :shock:

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
INSBASE setting
« Reply #1 on: July 21, 2005, 02:05:57 PM »
INSBASE shouldn't be 'moving' anything.....it is merely the point used for the insertion point when inserting the drawing as a block or xref.

Now if you want to move everything relative to the old/new insbase, then yes, a routine could be written for that.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
INSBASE setting
« Reply #2 on: July 21, 2005, 04:40:32 PM »
I think I know what TJ is getting at.

When you wblock out any part of a drawing and specify the basepoint of the block, it often has weird co-ords.

Quite recently I have been going through many of our blocks and found a weird insbase and strange x and y co-ords. I like my drawings to be based at 0,0 so I have been moving all the drawing entities to a base point of 0,0 and resetting the ins-base at 0,0.

What I THINK they were asking is, is there a way to automate the way to do it (or is that what you'd guessed :oops: )

If there was such a routine I would certainly be interested in it too.
Thanks for explaining the word "many" to me, it means a lot.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
INSBASE setting
« Reply #3 on: July 21, 2005, 05:03:25 PM »
Quote from: jonesy

What I THINK they were asking is, is there a way to automate the way to do it (or is that what you'd guessed :oops: )

If there was such a routine I would certainly be interested in it too.

Yep, that's what I thought they were trying to say..... I think that this little lisp will do the trick. Just load it and run ZEROBASE.
Code: [Select]

(defun c:zerobase (/ doc ms lays lokt base lays)
  (vl-load-com)
  (setq doc  (vla-get-activedocument (vlax-get-acad-object))
ms   (vla-get-modelspace doc)
lays (vla-get-layers doc)
base (getvar "insbase")
  )
  (if (not (= 0.0 (car base) (cadr base)))
    (progn
      (vlax-for lay lays
(if (eq (vla-get-lock lay) :vlax-true)
 (progn
   (setq lokt (cons (vla-get-name lay) lokt))
   (vla-put-lock lay :vlax-false)
 )
)
      )
      (setvar "insbase" '(0.0 0.0 0.0))
      (vlax-for obj ms
(vlax-invoke obj 'move base '(0.0 0.0 0.0))
      )
    )
  )
  (if lokt
    (mapcar '(lambda (x)
      (vla-put-lock (vla-item lays x) :vlax-true)
    )
   lokt
    )
  )
  (princ)
)