CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-11-2008, 02:20 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Automatic staggering of dimension

Hi,

just wondering if anyone already made a lisp tool for this....
See attached picture. I managed to make this with Modify Dims > Stagger Line, and dragging with the vertices of the dim lines afterwards. But it's quite a lot of work, and you won't be sure if the extension lines are parellel.
We'll be using this kind of dims more and more, so it would be nice if it would be possible to do this by selecting the dim, and clicking 2 points or so.
Anyone??
Thanks!
Regards,
Jaap
Attached Thumbnails
Click image for larger version

Name:	staggered_dim.jpg
Views:	365
Size:	13.7 KB
ID:	1022  
Reply With Quote
  #2  
Old 01-11-2008, 06:14 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Automatic staggering of dimension

Hi again,

ok, I couldn't resist, and tried if I could make it work. And I was lucky
Here's the code:
Code:
(in-package :JAAP)
(use-package :OLI)

(sd-defdialog 'Stagger_Dim
  :dialog-title "Stagger Dim"

  :variables 
  	'(
  		(maat :selection (*sd-anno-dimension-seltype*) :prompt-text "Click on Dimension") 
		(factor :value-type :number :initial-value 0.2)
		(right :value-type :grouped-boolean)
		(left :value-type :grouped-boolean)


	) 
	
  	:mutual-exclusion '(right left)
	
	
  :local-functions 
  	'(
   		(doit ()
			(setf punt1 (sd-am-inq-dim-line-begin-pnt maat))
			(setf punt2 (sd-am-inq-dim-line-end-pnt maat))
			(setf punt3 (sd-am-inq-dim-extline1-begin-pnt maat))
			(setf punt3x (oli::gpnt2d_x punt3))
			(setf punt3y (oli::gpnt2d_y punt3))
			(setf punt4 (sd-am-inq-dim-extline1-end-pnt maat)) 
			(setf punt4x (oli::gpnt2d_x punt4))
			(setf punt4y (oli::gpnt2d_y punt4))
			(setf delta_y_3_4 (- punt4y punt3y))
			(setf delta_x_3_4 (- punt4x punt3x))
			(setf punt5 (sd-am-inq-dim-extline2-begin-pnt maat))
			(setf punt5x (oli::gpnt2d_x punt5))
			(setf punt5y (oli::gpnt2d_y punt5))
			(setf punt6 (sd-am-inq-dim-extline2-end-pnt maat))
			(setf punt6x (oli::gpnt2d_x punt6))
			(setf punt6y (oli::gpnt2d_y punt6))
			(setf delta_y_5_6 (- punt6y punt5y))
			(setf delta_x_5_6 (- punt6x punt5x))
			(setf tekstpunt (sd-am-inq-dim-text-cen-pnt maat))
			(setf tekstpuntx (oli::gpnt2d_x tekstpunt))
			(setf tekstpunty (oli::gpnt2d_y tekstpunt))
			(if right
				(progn
					(setf punt4a (make-gpnt2d :x (+ punt4x (* factor delta_y_3_4) ) :y (- punt4y (* factor delta_x_3_4) )))
					(setf punt6a (make-gpnt2d :x (+ punt6x (* factor delta_y_5_6) ) :y (- punt6y (* factor delta_x_5_6) )))
					(setf tekstpunta (make-gpnt2d :x (+ tekstpuntx (* factor delta_y_3_4) ) :y (- tekstpunty (* factor delta_x_3_4) )))
				)
				(progn
					(setf punt4a (make-gpnt2d :x (- punt4x (* factor delta_y_3_4) ) :y (+ punt4y (* factor delta_x_3_4) )))
					(setf punt6a (make-gpnt2d :x (- punt6x (* factor delta_y_5_6) ) :y (+ punt6y (* factor delta_x_5_6) )))
					(setf tekstpunta (make-gpnt2d :x (- tekstpuntx (* factor delta_y_3_4) ) :y (+ tekstpunty (* factor delta_x_3_4) )))
				)
			)
			(am_set_show :geo :off)
			(am_set_show :2d-geo :off)
			(am_set_show :c_geo :off)
			(am_set_show :hatching :off)
			(am_set_show :texts :off)
			(AM_DIM_RESET_LINE maat)
			(AM_DIM_STAGGER_LINE punt3 punt4 punt4a)
			(AM_DIM_STAGGER_LINE punt5 punt6 punt6a)
			(AM_DIM_MOVE_TEXT tekstpunt tekstpunta)
			(am_set_show :hatching :on)
			(am_set_show :c_geo :on)
			(am_set_show :2d-geo :on)
			(am_set_show :geo :on)
			(am_set_show :texts :on)
			
		)
	)


  :ok-action
	'(doit)
)
Enjoy!
Regards,
Jaap
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:14 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.