LISP to Dynamo

LISP to Dynamo

kylecook8278
Explorer Explorer
823 Views
5 Replies
Message 1 of 6

LISP to Dynamo

kylecook8278
Explorer
Explorer

Hey,

 

So I have a lisp that I want to modify slightly and bring into Dynamo.

 

Heres the LISP 

 

(defun C:BCAL ; = Block Contents of All Layers
(/ lyr lyrname)
(tblnext "layer" T); start at 0 [but don't Block it]
(while (setq lyr (tblnext "layer")); each subsequent Layer
(command
"_.block" (setq lyrname (cdr (assoc 2 lyr))) "0.85,0.5" (ssget "_X" (list (cons 8 lyrname))) ""
"_.insert" lyrname "_non" "0.85,0.5" "" "" ""
"_.chprop" "_last" "" "_layer" lyrname ""
); command
); while
(princ)
); defun

 

I bolded the text I wanted to be interactable. 

 

Can anyone give me any tips on where to start?

 

Thanks

 

0 Likes
824 Views
5 Replies
Replies (5)
Message 2 of 6

brian.strandberg
Advisor
Advisor

If you have it working in Lisp, why take the effort to bring into dynamo?

There isn't a converter or anything like that you can use to convert lisp to dynamo, it needs to be done from scratch.

 

Thanks!

Check out my Civil 3d blog at: http://c3dk.com/
Favorite Posts: Use Dynamo For Surface Analysis: https://youtu.be/eJNdX6guMP8
Fast Track your site grading with the new Corridor Workflow: https://youtu.be/Gg7u9-LgIL0
0 Likes
Message 3 of 6

kylecook8278
Explorer
Explorer

So the end goal is to make blocks automatically out of boring sticks. Right now I have gINT pumping them out (with layered to boring title) but Im trying to write something that autiomatically turns them a block with the layer name as the block name. 

The Lisp attached does this but it static on the placement of the basepoint of the block. I was trying to change it to the top point of the boring stick for each boring individually.

I was trying to bring it into dynamo because Im more familiar creating dynamo scripts than I am creating lisp. 

 

Thanks

0 Likes
Message 4 of 6

rgrainer
Collaborator
Collaborator

https://forum.dynamobim.com/search?q=insert%20block 

Have you tried searching at the dynamo forum?

 

"make blocks automatically out of boring sticks. Right now I have gINT pumping them out (with layered to boring title) " but Im trying to write something that autiomatically turns them a block with the layer name as the block name. 

I don't understand what you are trying to say in the bolded part above. Doesn't make sense to me.

0 Likes
Message 5 of 6

doni49
Mentor
Mentor

I'm also unsure what you're trying to do.  Based on your last reply, it sounds to me like you want the insertion point to vary.  If so, that's not the way block work.  Every instance of the block will always have the same insertion point.  In theory, you could make a block that uses a move parameter.  So that the blocks will all be placed with the same insertion point -- but then you'd select a grip and move the parameter causing the contents of the block to appear to have moved.  But that seems like a lot of unnecessary effort.

 

Can you post a sample dwg file showing what you're getting from the lisp routine and mark in there what you want to see changed if you were to use the new methodology?



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

0 Likes
Message 6 of 6

kylecook8278
Explorer
Explorer

So heres a sample drawing of what I get from gINT. The lisp I posted above changes all the borings into blocks (via the layer name) and names the block the layer name. The issue Im running into is the base point. right now it defaults it to a one point for all the boring. What I would like to it automatically put the base point for all the borings at the top middle point of each boring.

 

Im not sure if a lisp or Dynamo is the correct option. 

 

 

0 Likes