Jump to content

Begin line at block insertion point


stevesfr

Recommended Posts

Believe me, I feel and know your pain. I did (and still do some) survey work when I first started in CAD and it was a lot of 'dot connecting'. :) Hell, I'll be adding to to my own toolbox come Monday.

 

Out of curiosity, which OC version did you take? Did you see the last video I posted (where it connects everything matching selected object's description?

 

Alan:

My favorite CB version has a connecting line from last selected object to cursor.

Yes I saw the video, looks like the line connecting matching selected object's description could go bonkers now and then ? and then operator would have to guess which which is which and do editing. (or am I wrong?) I didn't see where I could copy and play with that version.

Again,love it!!

Been entering transparent command for this for years and years... thought it may have been impossible to fix / solve and get to this end. Now won't cuss surveyors for their data mess. I think I'll rename the command AT

S

Link to comment
Share on other sites

  • Replies 62
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    29

  • Lee Mac

    12

  • stevesfr

    11

  • Demesne

    6

Top Posters In This Topic

Posted Images

Upon further testing it seems you are corrent Sean, when using command, then current UCS is considered.

 

Only that in my experience, when retrieving entity coordinates, the plane in which the entity resides must be considered when transforming the coordinates - this plane may be different from both WCS and UCS.

 

Dealing with odd UCSs or OCSs does become a bit of a pain. The issue arises painfully more often in VBA, as it doesn’t hook into a command function, ThisDrawing.SendCommand, particularly well. :glare:

 

Adding a Rotation property into the mix makes the process even more of a handful. Here is a link that documents my VBA effort at coordinating the various factors (if anyone is interested). I suspect that task would have been trivial in Lisp.

 

http://discussion.autodesk.com/forums/thread.jspa?messageID=5825854

Link to comment
Share on other sites

Dealing with odd UCSs or OCSs does become a bit of a pain. The issue arises painfully more often in VBA, as it doesn’t hook into a command function, ThisDrawing.SendCommand, particularly well. :glare:

 

Adding a Rotation property into the mix makes the process even more of a handful. Here is a link that documents my VBA effort at coordinating the various factors (if anyone is interested). I suspect that task would have been trivial in Lisp.

 

http://discussion.autodesk.com/forums/thread.jspa?messageID=5825854

 

Thanks Sean, I'll have a read, but it takes me longer to look through VBA :)

 

Lee, what are your settings for Camtasia?

 

I use 'Recording Dimensions' to get the correct size when converting to a GIF. :)

Link to comment
Share on other sites

Alan:

My favorite CB version has a connecting line from last selected object to cursor.

Yes I saw the video, looks like the line connecting matching selected object's description could go bonkers now and then ? and then operator would have to guess which which is which and do editing. (or am I wrong?) I didn't see where I could copy and play with that version.

Again,love it!!

Been entering transparent command for this for years and years... thought it may have been impossible to fix / solve and get to this end. Now won't cuss surveyors for their data mess. I think I'll rename the command AT

S

Glad it helps. :)

Link to comment
Share on other sites

  • 1 month later...

Alan,

 

Is there any way that instaead of connecting with lines, the code in post #31 could work to connect objects with 3D polylines?

 

This is a great routine as it is. It's already saved me alot of time - thanks to you all!:)

 

Demesne

Link to comment
Share on other sites

Alan,

 

Is there any way that instaead of connecting with lines, the code in post #31 could work to connect objects with 3D polylines?

 

This is a great routine as it is. It's already saved me alot of time - thanks to you all!:)

 

Demesne

I might play with it later.

 

vlax-3d-point

Nope.

Link to comment
Share on other sites

I failed first!! Thanks anyway.

 

..and thanks Alan. I am currently using Dotsoft ToolPac so converting to and joining 3D polys is easy enough - Just takes a little more time! :roll:

Link to comment
Share on other sites

I'd hate to deprive you of getting your money's worth from your DotSoft package.

 

oc.gif

 

I've been using this a bit myself. I think I may do a bit more developing on this.

Link to comment
Share on other sites

Well, only in as much as I looked at the code and then realised there wasn't a simple line to change from say 'line' to '3dpolyline'. I sometimes manage to tweak lisp to do what I want it to but those changes are very basic. My programming capabilities are limited to Casio calculators! I wish I had more time to sit down and learn how to actually write my own code.

 

I see from your animation that you have connected with a polyline, can this be done with a 3D polyline?

Link to comment
Share on other sites

Give this a go:

 

(defun c:BlkCon ( / ent l gr code data ss )
 (vl-load-com)
 ;; © Lee Mac 2010

 (if (setq ent
       (LM:SelectifFoo
         (lambda ( x )
           (eq "INSERT" (cdr (assoc 0 (entget x))))
         )
         "\nSelect Block: "
       )
     )
   (progn
     (setq l (list (cdr (assoc 10 (entget ent)))))
     
     (while
       (progn
         (setq gr (grread 't 13 2) code (car gr) data (cadr gr))

         (redraw)

         (cond
           (
             (and (= 5 code) (listp data))

             (mapcar
              '(lambda ( from to )
                 (grdraw (trans from 0 1) (trans to 0 1) 4 1)
               )
               (cons (trans data 1 0) (reverse (cdr (reverse l)))) l
             )
            t
           )
           (
             (and (= 3 code) (listp data))

             (if (setq ss (ssget data '((0 . "INSERT"))))
               (setq l (cons (cdr (assoc 10 (entget (ssname ss 0)))) l))
             )
           )
           ( (member code '(13 32 25)) nil )
           
           ( t )
         )
       )
     )
     (entmakex
       (list
         (cons 0 "POLYLINE")
         (cons 10 '(0 0 0))
       )
     )
     (mapcar
      '(lambda ( p )
         (entmakex
           (list (cons 0 "VERTEX") (cons 10 p))
         )
       )
      l
     )
     (entmakex (list (cons 0 "SEQEND")))
   )
 )
 (princ)
)

(defun LM:SelectifFoo ( foo str / sel ent )
 ;; © Lee Mac  ~  12.06.10
 (while
   (progn
     (setq sel (entsel str))
     
     (cond
       (
         (vl-consp sel)

         (if (not (foo (setq ent (car sel))))
           (princ "\n** Invalid Object Selected **")
         )
       )
     )
   )
 )
 ent
)

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