#1
|
||||
|
||||
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 |
#2
|
||||
|
||||
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) ) Regards, Jaap |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|