Lee Mac Posted April 29, 2010 Posted April 29, 2010 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 ;; ;; ;; ;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;; ;; ;; ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;; ;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;; Lee Block Align.lsp Quote
stevesfr Posted April 29, 2010 Posted April 29, 2010 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 ;; ;; ;; ;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;; ;; ;; ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;; ;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;; Lee Is it possible to add a scale option for the block? Steve Quote
Lee Mac Posted April 29, 2010 Author Posted April 29, 2010 You mean when a new block is inserted to align? Quote
stevesfr Posted April 29, 2010 Posted April 29, 2010 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 Quote
Lee Mac Posted April 30, 2010 Author Posted April 30, 2010 Thanks Steve, I shall see what I can do Quote
Lee Mac Posted April 30, 2010 Author Posted April 30, 2010 Try this Steve: Block Align V1.1.lsp Quote
alanjt Posted April 30, 2010 Posted April 30, 2010 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. Quote
Lee Mac Posted April 30, 2010 Author Posted April 30, 2010 I have to insert it if the block is not in the drawing. Quote
alanjt Posted April 30, 2010 Posted April 30, 2010 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. Quote
Lee Mac Posted April 30, 2010 Author Posted April 30, 2010 I retract my statement; didn't realize you were giving that option. No worries I wanted to give the user every option possible Quote
stevesfr Posted April 30, 2010 Posted April 30, 2010 Try this Steve: Hot damn, you are the man. This is perfect !!!!!! Thanks mate! All should appreciate this new version !!! Steve Quote
Crank Posted May 1, 2010 Posted May 1, 2010 The demo looks like a box with text. So why do you stick to a block when you could also align a selection set. Quote
Lee Mac Posted May 1, 2010 Author Posted May 1, 2010 The demo is an attributed block (as the text says) Quote
Crank Posted May 1, 2010 Posted May 1, 2010 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. Quote
alanjt Posted May 1, 2010 Posted May 1, 2010 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. Quote
Lee Mac Posted May 1, 2010 Author Posted May 1, 2010 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 Quote
Lee Mac Posted May 1, 2010 Author Posted May 1, 2010 (edited) How about something like this Crank? Latest Code in Later Post Edited May 7, 2011 by Lee Mac Quote
Recommended Posts
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.