jan_ek Posted March 30, 2018 Share Posted March 30, 2018 Hello Do you think it's possible Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted March 31, 2018 Share Posted March 31, 2018 It is possible, but it needs lots of coding... When _B1 is created I suggest that you put XDATA of each layer widths to _B1, so that when you later do _B2 it creates exactly the same layers obtained from _B1... When subtracting to get hole, you need exploding of _B1, exploding of _B2, subtracting each layer and finally redefining _B1... So it could be done, but you need to code it (if you need it)... BTW. I work with normal 3dsolids as layers - never had a need for creating blocks... So manually subtracting each layer is way more usable than some other methods like described... Beside that, you only need to provide larger layer widths of parts you are subtracting with, so even no need for XDATA - you remember those numbers 100,200,300 - there can't be millions of them... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 31, 2018 Share Posted March 31, 2018 (edited) Why would you not just create the solid and put hole in as part of creating solid and do 3 times then make block of the 3 objects using lisp ? Is there a reason why you do it in two steps ? Just use the elev function to stack the solids during creation. If multiples of these 3 solids are different sizes then look at dynamic block much quicker. Ask a b c length height e d length height make 3 solids save block1 subtract plug make plug 3 solids save block2 This needs repeat function etc for 2x3 solids just a start. Very rough shoudl use defuns then can stack as many or as few etc. Caution creates 2 blocks so may need a insert to see result. (defun c:test ( / pt1 pt2 pt3 l h e d l1 h2 ent1 ent2 ent3 ent21 ent22 ent23) (setq a 100 b 120 c 200) (setq pt1 (getpoint "point")) (setq L (getdist pt1 "length")) (setq h (getdist pt1 "Height")) (setq e (getdist pt1 "Offset e")) (setq d (getdist pt1 "Offset d")) (setq L2 (getreal "Length 2")) (setq h2 (getreal "Height 2")) (command "rectang" pt1 (list (+ (car pt1) L) (+ (cadr pt1 ) h))) (command "zoom" "e") (command "extrude" "l" "" a) (setq ent1 (entlast)) (setq pt2 (list (+ (car pt1) e) (+ (cadr pt1 )d) )) (setq pt3 (list (+ (car pt2) l2) (+ (cadr pt2 ) h2) )) (command "rectang" pt2 pt3) (command "extrude" "l" "" a) (setq ent12 (entlast)) (command "subtract" ent1 "" ent12 "") ; 2nd layer (setq pt1 (list (car pt1)(cadr pt1) a)) (command "rectang" pt1 (list (+ (car pt1) L) (+ (cadr pt1) h) a)) (command "extrude" "l" "" b) (setq ent2 (entlast)) (setq pt2 (list (+ (car pt1) e) (+ (cadr pt1 )d) a)) (setq pt3 (list (+ (car pt2) l2) (+ (cadr pt2 ) h2) a)) (command "rectang" pt2 pt3) (command "extrude" "l" "" b) (setq ent22 (entlast)) (command "subtract" ent2 "" ent22 "") ; 3rd layer (setq pt1 (list (car pt1)(cadr pt1) (+ a b))) (command "rectang" pt1 (list (+ (car pt1) L) (+ (cadr pt1) h) (+ a b))) (command "extrude" "l" "" c) (setq ent3 (entlast)) (setq pt2 (list (+ (car pt1) e) (+ (cadr pt1 )d) (+ a b))) (setq pt3 (list (+ (car pt2) l2) (+ (cadr pt2 ) h2) (+ a b))) (command "rectang" pt2 pt3) (command "extrude" "l" "" c) (setq ent32(entlast)) (command "subtract" ent3 "" ent32 "") ; block part (command "-block" "BIGAL" (list (car pt1)(cadr pt1) 0.0) ent1 ent2 ent3 "") ; now create plugs ; like above 3 times ; put pt1 back to z=0 (setq pt1 (list (car pt1)(cadr pt1) 0.0)) (setq pt2 (list (+ (car pt1) e) (+ (cadr pt1 )d) )) (setq pt3 (list (+ (car pt2) l2) (+ (cadr pt2 ) h2))) (command "rectang" pt2 pt3) (command "extrude" "l" "" a) (setq ent21 (entlast)) (setq pt2 (list (+ (car pt1) e) (+ (cadr pt1 )d) a)) (setq pt3 (list (+ (car pt2) l2) (+ (cadr pt2 ) h2) a)) (command "rectang" pt2 pt3) (command "extrude" "l" "" b) (setq ent22 (entlast)) (setq pt2 (list (+ (car pt1) e) (+ (cadr pt1 )d) (+ a b))) (setq pt3 (list (+ (car pt2) l2) (+ (cadr pt2 ) h2) (+ a b))) (command "rectang" pt2 pt3) (command "extrude" "l" "" c) (setq ent23 (entlast)) (command "-block" "BIGAL2" (list (car pt1)(cadr pt1) 0.0) ent21 ent22 ent23 "") (command "Insert" "bigal" pt1 1 1 0) ) (c:test) Edited April 1, 2018 by BIGAL Quote Link to comment Share on other sites More sharing options...
jan_ek Posted April 1, 2018 Author Share Posted April 1, 2018 Hello, I use two step because it will not always be a cuboid. I would like to create shape database to cutting\adding Thank you for the initial code. You can eliminate the commands function ? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 1, 2018 Share Posted April 1, 2018 I don't understand eliminate command function. Do you want it as a script ? The shape can be any you want just write a pline routine with points last is close. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 2, 2018 Share Posted April 2, 2018 .... You can eliminate the commands function ? HERE is an example how to subtract solids/regions not using command calls. Quote Link to comment Share on other sites More sharing options...
jan_ek Posted April 3, 2018 Author Share Posted April 3, 2018 Hello Please see video (0:25) https://www.youtube.com/watch?v=iXk1FEP3T7M1 I don't know what solution it's ok,but I would like to similar solution. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 4, 2018 Share Posted April 4, 2018 That is Revit not Autocad completely different way of thinking uses objects. Autocad only see the holes in the walls Quote Link to comment Share on other sites More sharing options...
jan_ek Posted April 14, 2018 Author Share Posted April 14, 2018 Hello BIGAL Yes, I understand that this is not a revit But I mean exactly what you showed me. I just want the holes to be defined in a separate file. I would like to only be able to insert them in a revit. Thank you for your interest in the topic Quote Link to comment Share on other sites More sharing options...
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.