Jump to content

Recommended Posts

Posted

Inspired by this thread, I thought I'd write a program to Align a Block to a Curve.

 

More details in the header :)

 

;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;;                                                                               ;;
;;                                                                               ;;
;;                          --=={  Block Align  }==--                            ;;
;;                                                                               ;;
;;  Will align a block to a CurveObject [Arc,Line,Polyline,Ellipse,etc], with    ;;
;;  controllable offset and perpendicularity.                                    ;;
;;                                                                               ;;
;;  User is prompted for block specification, block will be inserted if not      ;;
;;  selected. User can also specify whether block should be rotated to suit      ;;
;;  readability.                                                                 ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  FUNCTION SYNTAX:  BA                                                         ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  AUTHOR:                                                                      ;;
;;                                                                               ;;
;;  Copyright © Lee McDonnell, April 2010. All Rights Reserved.                  ;;
;;                                                                               ;;
;;      { Contact: Lee Mac @ TheSwamp.org, CADTutor.net }                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  VERSION:                                                                     ;;
;;                                                                               ;;
;;  ø 1.0   ~¤~    29th April 2010   ~¤~   º First Release                       ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;

 

BAlignV1-0.gif

 

Lee

Block Align.lsp

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    32

  • alanjt

    9

  • TimZilla

    4

  • Crank

    4

Top Posters In This Topic

Posted
Inspired by this thread, I thought I'd write a program to Align a Block to a Curve.

 

More details in the header :)

 

;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;;                                                                               ;;
;;                                                                               ;;
;;                          --=={  Block Align  }==--                            ;;
;;                                                                               ;;
;;  Will align a block to a CurveObject [Arc,Line,Polyline,Ellipse,etc], with    ;;
;;  controllable offset and perpendicularity.                                    ;;
;;                                                                               ;;
;;  User is prompted for block specification, block will be inserted if not      ;;
;;  selected. User can also specify whether block should be rotated to suit      ;;
;;  readability.                                                                 ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  FUNCTION SYNTAX:  BA                                                         ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  AUTHOR:                                                                      ;;
;;                                                                               ;;
;;  Copyright © Lee McDonnell, April 2010. All Rights Reserved.                  ;;
;;                                                                               ;;
;;      { Contact: Lee Mac @ TheSwamp.org, CADTutor.net }                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  VERSION:                                                                     ;;
;;                                                                               ;;
;;  ø 1.0   ~¤~    29th April 2010   ~¤~   º First Release                       ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;

 

BAlignV1-0.gif

 

Lee

 

Is it possible to add a scale option for the block?

Steve

Posted
You mean when a new block is inserted to align?

 

Yes, my trials show the block coming in at scale of 1:1 no matter what I try to do, unless I redefine the block. The block is built at a scale of 1. I always work in units of feet 99% of the time. Detail sheets are unique to themselves with scales all over the place, one good reason to have ability to introduce a new scale before insert.

Just a suggestion from someone who appreciates your work.

Steve

Posted

Out of curiosity Lee, why insert the block instead of just making a copy of it? If you copy, you won't have to worry about any layer, scale, etc. issues.

Posted

I have to insert it if the block is not in the drawing.

Posted
I have to insert it if the block is not in the drawing.

I retract my statement; didn't realize you were giving that option.:)

Posted
I retract my statement; didn't realize you were giving that option.:)

 

No worries :) I wanted to give the user every option possible :)

Posted
Try this Steve:

 

Hot damn, you are the man. This is perfect !!!!!! Thanks mate!

All should appreciate this new version !!!

Steve

Posted

Mr.Lee McDonnell

 

Thanks, Is Perfect works

amr

Posted

The demo looks like a box with text. So why do you stick to a block when you could also align a selection set.

Posted

The demo is an attributed block (as the text says) :)

Posted

I mean: You can make a temparary block of a selection set. Align it, and explode this temporary block when you exit the routine. That way the lisp will work for everything.

 

Nb. I think it should be possible to place the block on the line, like the alignmentgrip of a dynamic block.

Posted
I mean: You can make a temparary block of a selection set. Align it, and explode this temporary block when you exit the routine. That way the lisp will work for everything.

 

Nb. I think it should be possible to place the block on the line, like the alignmentgrip of a dynamic block.

Something similar.

Posted
I mean: You can make a temparary block of a selection set. Align it, and explode this temporary block when you exit the routine. That way the lisp will work for everything.

 

Nb. I think it should be possible to place the block on the line, like the alignmentgrip of a dynamic block.

 

True, I suppose that could be done :)

Posted (edited)

How about something like this Crank?

 

Latest Code in Later Post

Edited by Lee Mac

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