CAD Forums > CAD General

_offset without the snap

(1/3) > >>

CAB:
You would think there would be an easy fix for this but it eludes me.

The Offset button has the following code

--- Code: ---^C^C_offset
--- End code ---


I would like to turn off osnaps if they were on, run the offset & turn them back on if they were on.

I used Se7en's on/off osnaps routine to turn them off like this


--- Code: ---^C^C(c:setosnaps 0);_offset
--- End code ---


anything I add after the _offset is processed as input for the command.

Tried  
--- Code: ---^C^C(c:setosnaps 0);_offset;(c:setosnaps 1)
--- End code ---

Tried  
--- Code: ---^C^C_offset\non
--- End code ---


The problem with adding commands after the _offset is that it disrupts the normal operation
of the command. That is once you enter the offset distance the command repeates.
This repeat feature is lost, but i want it to repeat.

Enlighten me please. :(

CAB

CADaver:
??  I am under the impression that OSNAPs do not effect OFFSET.  Is there some reason you need to turn them off to OFFSET??

Mark:
take a look at this cab, maybe you'll get some ideas

--- Code: ---
;
; ---------------------------------------------
; selection set of offset objects.
(defun selset (/ ent1 *ss*)
  ; create an empty selection set
  (setq *ss* (ssadd))
  (setq ent1 (entlast))
  (progn
    ; start the offset command
    (command ".OFFSET")
    (while
      ; loop until the user is done with offset
      (< 0 (getvar "CMDACTIVE"))
      (command pause)
       (if
         (not (equal ent1 (entlast)))
        (progn
          ; this will get the object that was offset
          (setq ent1 (entlast))
          ; then add it 'ent1' to the selection set
          (setq *ss* (ssadd ent1 *ss*))
          ) ; progn
        ) ; if
      ) ; while
    ) ; progn
  *ss*
  ) ; defun


; --------------- MAIN FUNCTION -------------------------
(defun c:of3 (/ ln sls eachEnt lst cntr)

  (if
    (and
      ; if both are true then call 'selset'
      (setq ln (strcase (getstring "Destination Layer Name: ")))
      (tblsearch "LAYER" ln); look in dwg for layer 'ln'
      ); and
    (setq sls (selset)); call 'selset' for a selection set.
    ; else
    (alert (strcat "No Layer--> "ln" <-- Found"))
    ); if

  (if sls
    (progn
      (setq cntr 0)
      (while
        ; continue until this is nil, no more in selection set
        (setq eachEnt (ssname sls cntr))
        ; create a list of the DXF values for 'eachEnt'
        (setq lst (entget eachEnt))
        ; modify the list 'lst' with the new layer name 'ln'
        (setq lst (subst (cons 8 ln) (assoc 8 lst) lst))
        ; modify the dwg object/entity
        (entmod lst)
        (setq cntr (1+ cntr))
        ); while
      )
    ); if
  (setq sls nil); selection set
  (princ)  
  ); defun      

--- End code ---

Dent Cermak:
If you have your snap set to "endpoint" you can end up with your offset going funny places. "Node" can mess you up too when it asks yo to select the offset side.

CAB:
Mark, will that fit in the button? :lol:  just kidding...
I'll give it a look.


CADaver, when you pick the object to offset you are then asked to pick the side to offset to.
At that time the snap become active if it is turned on.
It never fails that if I pick empty space on one side it snaps to the other.

 It has been a pebble in my shoe for a long time.:(

CAB

Navigation

[0] Message Index

[#] Next page

Go to full version