Modify lisp routine from an external to internal function

Modify lisp routine from an external to internal function

erichter
Advocate Advocate
264 Views
3 Replies
Message 1 of 4

Modify lisp routine from an external to internal function

erichter
Advocate
Advocate

I would like to use the Lee Mac script "Justify Block Base Point" within my own lisp routine to change the basepoint of a block to be at the bottom left corner of its bounding box. However, it's designed as a standalone script with a UI. How can I modify this for it to be used an internal function with the variables "bln" and "jus" are inputs?

 

The script I am referring to is at the link below:

 

http://www.lee-mac.com/justifybasepoint.html 

0 Likes
265 Views
3 Replies
Replies (3)
Message 2 of 4

devitg
Advisor
Advisor

@erichter You should ask  LEE-MAC. the author 

0 Likes
Message 3 of 4

diagodose2009
Collaborator
Collaborator

This program, contains too many function/s inside. 

For that reason, you must transform the JustifyBasePointV1-1.lsp to   JustifyBasePointV1-1.zip.for more editable features., you need program features inside.

You transpile the JustifyBasePointV1-1.lsp to  pp_vengatcolor.zip 

 

 

0 Likes
Message 4 of 4

Sea-Haven
Mentor
Mentor

1st suggestion is contact Lee and ask.

 

What does this do for you, compare origin with your lower left. Not really tested much. Just use bounding box on block. May need Attsync after running.

(defun whoknows ( / obj bname pointmin pointmax x y blks blk)
(setq obj (vlax-ename->vla-object (car (entsel "pick object "))))
(setq bname (vla-get-effectivename obj))
(vla-GetBoundingBox obj 'minpoint 'maxpoint)
(setq pointmin (vlax-safearray->list minpoint))
(setq pointmax (vlax-safearray->list maxpoint))
(setq inspt (vlax-get Obj 'insertionPoint))
(setq x (- (car pointmin)(car inspt) )
Y (- (cadr pointmin)(cadr inspt) )
)
(setq blks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
(vlax-for blk blks
(if (= (vla-get-name blk) bname)
(vla-put-origin blk (list X Y 0.0) )
)
)
(princ)
)
(whoknows)

 

 

0 Likes