Jump to content

Fast command activaction


Butch

Recommended Posts

Hello!

Is it possible to double-click over a line, or dimesion, or a hatch and instantly start using the tool over wich you have double-clicked.

 

So eg. you have a line thats on a layer 01,with its lineweight and linetype. You double-click over it, and you instantly have a line command active with all the previous settings that go with the line over wich you have double-clicked. Same goes for hatching, dimesion lines...

This would be a great time saviour!

Once I have my tool placed on drawing, I dont have to switch layers, maybe change settings, define hatch....just double-click over the egsisting item and your off!

Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    14

  • Butch

    12

  • BIGAL

    5

  • RFRUSSO

    2

Top Posters In This Topic

You could pretty easy create a lisp or vba to just do what you want, regarding double clicking not sure. Once you invoke the program it could be set to continue till you force an exit pretty easy pick nothing. Maybe set the program to load from a single key press. (remap function key) It can be something simple also like type zz (z is lower left easy to find)

 

Ps single pick required on object

Link to comment
Share on other sites

I keep the properties dialog box open at all times for just that reason. Once you select an object there are all sorts of wonderful options that can be quickly modified.

Link to comment
Share on other sites

I keep the properties dialog box open at all times for just that reason. Once you select an object there are all sorts of wonderful options that can be quickly modified.

 

Just off a wonderful months' vacation in Key West, FL.

Missed the forums, Greetings forum members!

 

I use the dialog box frequently, minimized on the sidebar, always ready to open and modify properties when I need to. Which is not too often but, often enough! 8)

Link to comment
Share on other sites

I use the dialog box frequently, minimized on the sidebar, always ready to open and modify properties when I need to. Which is not too often but, often enough! 8)

 

You sound like a man that needs a second screen. I don't know how I got through 8 years of drawing stuff with only 1!

Link to comment
Share on other sites

Something like this Butch?

 

{Can be expanded if necessary}

 

(defun c:MapCom (/ ent Obj lEnt)
 (vl-load-com)
 (while (setq ent (car (nentsel "\nSelect Object: ")))
   (setq Obj (vlax-ename->vla-object ent)
         typ (cdr (assoc 0 (entget ent))))
   (cond ((vl-position typ '("CIRCLE" "ARC" "ELLIPSE" "SPLINE" "XLINE"))
          (comInv typ) (PropMatch Obj (entlast)))
         ((eq "LWPOLYLINE" typ)
          (comInv "pline") (PropMatch Obj (entlast)))
         ((eq "LINE" typ)
          (setq lEnt (entlast))
          (comInv typ)
          (foreach ent (EntCol (if lEnt lEnt (entlast)))
            (PropMatch Obj ent)))))
 (princ))

(defun PropMatch (bObj dObj)
 (or (eq 'VLA-OBJECT (type bObj))
     (setq bObj (vlax-ename->vla-object bObj)))
 (or (eq 'VLA-OBJECT (type dObj))
     (setq dObj (vlax-ename->vla-object dObj)))
 (foreach prop '(Layer Linetype LinetypeScale Color Lineweight)
   (if (and (vlax-property-available-p bObj prop)
              (vlax-property-available-p dObj prop T))
     (vlax-put-property dObj prop
       (vlax-get-property bObj prop)))))

(defun EntCol (x / x)
 (if (setq x (entnext x))
   (cons x (EntCol x))))

(defun comInv (com)
 (command (strcat "_." com))
 (while (eq 1 (logand 1 (getvar "CMDACTIVE")))
   (command pause)))
                   

Link to comment
Share on other sites

Lee Mac, its nopt working here :-(

I get an tetxt saying select object, i tried selecting an line, selected it, but nothing happens :-(

Treid also with few other objects but nothing :-(

Every time the same promt "select object"

Link to comment
Share on other sites

Lee Mac, its nopt working here :-(

I get an tetxt saying select object, i tried selecting an line, selected it, but nothing happens :-(

Treid also with few other objects but nothing :-(

Every time the same promt "select object"

 

What is your CMDECHO set to Butch? It all works fine my end.

Link to comment
Share on other sites

Isn't that the same as match properties? :geek:

 

MA defualt command

 

Not quite - Match properties matches the properties of the object after it has been drawn, this does it whilst the object is being drawn.

 

If it were me, I would use Match Properties - as it would have much better coding than anything I could make - but I am just following the OP's request.

Link to comment
Share on other sites

Hey Lee tried it out works great! altered the 1st line to

(defun c:ZZZ (/ ent Obj lEnt) and added it to our start up lisps so we can all try it out.

 

Found a couple of things and I will have a go at adding and repaste here.

Link to comment
Share on other sites

You sound like a man that needs a second screen. I don't know how I got through 8 years of drawing stuff with only 1!

 

I see quite well on a 36" LCD wall mounted, tilt 'n swivel, monitor! 8)

Room to spare however, I can't figure out why my prints are smaller? :?

Link to comment
Share on other sites

Hey Lee tried it out works great! altered the 1st line to

(defun c:ZZZ (/ ent Obj lEnt) and added it to our start up lisps so we can all try it out.

 

Found a couple of things and I will have a go at adding and repaste here.

 

Excellent BigAl :D

 

As I say, its only in preliminary stages - just to try out the idea - there's bound to be a few bits wrong :P

 

Lee

Link to comment
Share on other sites

Its set to 1

Is that bad?

 

No, I was hoping you'd say 0, so that I could tell you to set it to 1.. :wink:

 

Does it not work on anything at all?

Link to comment
Share on other sites

To Butch I saved the program and it works no problems. maybe re save it, copy the text and then paste it into Notepad not Word etc then save. Have had niggly problems with Word just use Notepad now only.

 

To Lee looking at adding text and leaders, also was going to add a "This object can not be replicated" probably for Xref and 3D faces and any other object thats not added properly to list in the code.

Link to comment
Share on other sites

o.k. I tried it again and in works on some objects. I dont know why but from some reasone the tool wasnt working on my "vertical line" (I marked them in my drawing attached). I realy dont get why the hell it not working on them. Otherwise it seems to be working fine.

I know this was the first try but I woulf realy love if you could make this thing work on hatches, so it picks up hatch style and scale after you click over it and then just place a new hatch. Same goes for dimensions and mtext style and height.

Lee Mac what do you think, could it be done?

http://rapidshare.com/files/248765546/try.dwg.html

Link to comment
Share on other sites

I'm sure I could put a hell of a lot more into this tool. I just slapped together some code to begin with to see if the tool was how you envisioned it to be. But, if you are pleased with it, I can put more into it :D

 

Btw, I don't even use Notepad, to first test LISPs, I just copy the code straight into the Visual LISP Editor, where it can be loaded and edited on the fly. :)

Link to comment
Share on other sites

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...