Jump to content

Recommended Posts

Posted

how does it work? I just choice a cir. that I want to use as a wipeout and it turns in to a 200 segmeny PL?

  • Replies 49
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    22

  • CadTechJGC184

    19

  • automicro

    4

  • CmdrDuh

    3

Posted

Exactly,

 

You choose a circle, it will take a distance along that circle and make a polyline vertex, then it will turn the polyline into a wipeout and delete the circle.

Posted

cool! I'm going to give it a try right now. Do you have a lisp that will trun on and off an Image Frame everytime I type "IF"?

Posted

Hows this:

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:IF [b][color=RED]([/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]cond[/color][/b] [b][color=RED]([/color][/b]img:def
        [b][color=RED]([/color][/b][b][color=BLUE]command[/color][/b] [b][color=#ff00ff]"_imageframe"[/color][/b] [b][color=#ff00ff]"_on"[/color][/b][b][color=RED])[/color][/b]
        [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] img:def [b][color=BLUE]nil[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]T[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]command[/color][/b] [b][color=#ff00ff]"_imageframe"[/color][/b] [b][color=#ff00ff]"_off"[/color][/b][b][color=RED])[/color][/b]
        [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] img:def [b][color=BLUE]T[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

Posted

I will try that IF in a min. I can't seem to save the cwipe as a lisp. It keeps saving it as a txt file. I know I'm doing it right.

Posted

OHHHH i got it. I never added ".lsp" at the end!!

Posted

Lee Mac,

 

The IF just brings up the imageframe promt. I then have to tell it to turn on or off. I was hoping it would do that for me. Like if the frames are ON and I ytpe IF it will turn the frames OFF. and so on.

Posted

Thanx for the CWIPE... It works great!!

Posted
Lee Mac,

 

The IF just brings up the imageframe promt. I then have to tell it to turn on or off. I was hoping it would do that for me. Like if the frames are ON and I ytpe IF it will turn the frames OFF. and so on.

 

Hmmm... shouldn't do - I can't replicate that on mine, but then I'm using '04.

 

what are the order of prompts when you type imageframe at the command line?

Posted

I'm using 2006.

 

This is what promts when I type IF:

 

"Enter image frame setting [0, 1, 2] :"

Posted

Ahh, slightly different to mine.

 

Ok, try this:

 

(defun c:IF ()
 (cond (img:def
        (command "_imageframe" "1")
        (setq img:def nil))
       (T (command "_imageframe" "0")
        (setq img:def T)))
 (princ))

Posted

YES...... you are the man! You like a mad scientist!! hahaha

 

It works great! Thank you! I know I've asked you before about a leader that ends after 3 picks. It doesn't ask me to add text or where I have to select "NONE". Got any thing like that? Also, Is this your site?

Posted
YES...... you are the man! You like a mad scientist!! hahaha

 

haha thanks :D

 

It works great! Thank you! I know I've asked you before about a leader that ends after 3 picks. It doesn't ask me to add text or where I have to select "NONE". Got any thing like that?

 

This is hard to do tbh as there aren't system variables that store settings for the leaders - I think you have to modify the dictionary entry.

 

Also, Is this your site?

 

No - CADTutor (David Watson) is the admin. :D

Posted

This is all I could think of... written very quickly (not proud of this one :( ):

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:ql  [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] doc spc pt pt2 pt3[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-Acad-Object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       spc [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]zerop[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-activespace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-mspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=Blue]:vlax-true[/color][color=RED])[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]vla-get-paperspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] [b][color=#ff00ff]"\nStart Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
          [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt2 [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] pt [b][color=#ff00ff]"\nSecond Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
          [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt3 [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] pt2 [b][color=#ff00ff]"\nThird Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]vla-AddLeader[/color][/b] spc
     [b][color=RED]([/color][/b][b][color=BLUE]vlax-make-variant[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray-fill[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]vlax-make-safearray[/color][/b]
           [b][color=Blue]vlax-vbdouble[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]1-[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]length[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]append[/color][/b] pt pt2 pt3[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]append[/color][/b] pt pt2 pt3[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-addMtext[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]vlax-3d-point[/color][/b] pt3[b][color=RED])[/color][/b] [b][color=#009900]0[/color][/b] [b][color=#ff00ff]""[/color][/b][b][color=RED])[/color][/b]
     [b][color=Blue]acLinewithArrow[/color][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

Posted

I will try this one asap! I'm glad ppl like you are on this site. THANK YOU FOR ALL YOU'RE DOING FOR PPL LIKE MYSELF....

Posted

YEP... works great.... thank you!!

Posted
I will try this one asap! I'm glad ppl like you are on this site. THANK YOU FOR ALL YOU'RE DOING FOR PPL LIKE MYSELF....

 

 

Thanks CadTech, I just enjoy writing the LISPs - a like a bit of a challenge :D

Posted

OK.... here's one... Offset object to a distance and it puts the object that was offset to the current layer.

 

I got lots more!!

Posted

Haha, you can do that anyway:

 

EXOFFSET (Express tools).

 

Anyway going back to your leader issue, I found this online:

 

;;; qlset.lsp - example initialization of QLEADER settings
;;; Frank Whaley, Autodesk
;;; 
;;; Two functions are included in this file:
;;; 
;;; (acet-ql-Set)
;;; Returns an association list containing the current QLEADER settings from the
;;; Named Object Dictionary.
;;; 
;;; (acet-ql-get <alist>)
;;; Sets the specified values for QLEADER settings from the given association
;;; list.
;;; Returns an association list containing the new values.
;;; 
;;; These functions can be used to examine the current QLEADER settings, or to
;;; initialize the setting before using the QLEADER command.
;;; For example, to use splined leaders and framed text:
;;; 
;;; (acet-ql-set '((65 . 1)(72 . 1)))
;;; 
;;; Both functions use the following group codes to identify QLEADER settings:
;;; 
;;;  3: user arrowhead block name (default="")
;;;  40: default text width (default=0.0)
;;;  60: annotation type (default=0)
;;;      0=MText
;;;      1=copy object
;;;      2=Tolerance
;;;      3=block
;;;      4=none
;;;  61: annotation reuse (default=0)
;;;      0=none
;;;      1=reuse next
;;;  62: left attachment point (default=1)
;;;  63: right attachment point (default=3)
;;;      0=Top of top line
;;;      1=Middle of top line
;;;      2=Middle of multiline text
;;;      3=Middle of bottom line
;;;      4=Bottom of bottom line
;;;  64: underline bottom line (default=0)
;;;  65: use splined leader line (default=0)
;;;  66: no limit on points (default=0)
;;;  67: maximum number of points (default=3)
;;;  68: prompt for MText width (word wrap) (default=1)
;;;  69: always left justify (default=0)
;;;  70: allowed angle, first segment (default=0)
;;;  71: allowed angle, second segment (default=0)
;;;      0=Any angle
;;;      1=Horizontal
;;;      2=90deg
;;;      3=45deg
;;;      4=30deg
;;;      5=15deg
;;;  72: frame text (default=0)
;;; 170: active tab (default=0)
;;;      0=Annotation
;;;      1=Leader Line & Arrow
;;;      2=Attachment
;;; 340: object ID for annotation reuse
;;; 
;;; |;

acad-push-dbmod
(defun acet-ql-get  (/ xr cod itm reply)
 (if (setq xr (dictsearch (namedobjdict) "AcadDim"))
   (progn
     (foreach cod  '(3 40 60 61 62 63 64 65 66 67 68 69 70 71 72 170 340)
       (if (setq itm (assoc cod xr))
         (setq reply (append reply (list itm)))))
     reply)
   '((3 . "")
     (40 . 0.0)
     (60 . 0)
     (61 . 1)
     (62 . 1)
     (63 . 3)
     (64 . 0)
     (65 . 0)
     (66 . 0)
     (67 . 3)
     (68 . 1)
     (69 . 0)
     (70 . 0)
     (71 . 0)
     (72 . 0)
     (170 . 0))))

(defun acet-ql-set  (arg / cur prm)
 ;;  fetch current
 (setq cur (acet-ql-get))

 ;;  override per argument
 (while arg
   (setq prm (car arg)
         arg (cdr arg)
         cur (subst prm (assoc (car prm) cur) cur))
   ;;  handle DIMLDRBLK
   (if (= 3 (car prm))
     (setvar "DIMLDRBLK" (cdr prm))))

 ;;  put back
 (dictremove (namedobjdict) "AcadDim")
 (setq cur (append '((0 . "XRECORD") (100 . "AcDbXrecord") (90 . 990106))
                   cur))
 (dictadd (namedobjdict) "AcadDim" (entmakex cur))

 (acet-ql-get))

;;  load quietly
(princ)

(defun c:ql ()
 (acet-ql-set
   '((3 . "Open30")
     (40 . 0.0)
     (60 . 4)
     (61 . 0)
     (62 . 1)
     (63 . 3)
     (64 . 0)
     (65 . 0)
     (66 . 0)
     (67 . 3)
     (68 . 0)
     (69 . 0)
     (70 . 0)
     (71 . 0)
     (72 . 0)
     (170 . 0)))
 (princ))

 

Credit where credit's due - I could never have thought to do this!

 

Type "ql" for leader.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...