lisp

lisp

alaahashem
Enthusiast Enthusiast
1,596 Views
16 Replies
Message 1 of 17

lisp

alaahashem
Enthusiast
Enthusiast

Hi every one 
I need to get out that parcels  ( in parcel file ) in anew dwg file  -Each one separately- as Wblock command  as in its coordinates 
and also put it in aframe that  I attached also 
and do that automatic for all parcels

any one can help me 

0 Likes
Accepted solutions (1)
1,597 Views
16 Replies
Replies (16)
Message 2 of 17

RobDraw
Mentor
Mentor

Try asking over in the Customization and LISP forum.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 3 of 17

ВeekeeCZ
Consultant
Consultant

Well, no need to move to the customization forum... I can help you from here.

I think all you need you can find HERE !

Message 4 of 17

Sea-Haven
Mentor
Mentor

I did this about 3 years ago now over at cadtutor.net will try to find used the lot text as the how to find each lot. 

 

Its not that hard use bpoly to remake the outline.

0 Likes
Message 5 of 17

Sea-Haven
Mentor
Mentor

Is there any reason why you would not use layouts ? Much easier just zoom in on correct area. use a centroid of the pline.

0 Likes
Message 6 of 17

alaahashem
Enthusiast
Enthusiast

thanks for your reply ,I did that but small area with asmal number of parcels
, some time I have more than 1000 parcels and that soo more so I search about lisp / script do that easier
( 1- take one parcel in new drawing 
  2 - in that new drawing insert frame around parcel ( frame drawing have asmall frame to put parcel in it ) 
 3 - save that new drawing by name of parcel
 4 - back to orignal drawing and take the next parcel and so on....)
thanks

0 Likes
Message 7 of 17

marko_ribar
Advisor
Advisor

Hi, I mod. your DWG so that now parcel numbers are visible and also added LWPOLYLINE outlines as also area values... You should be able to continue processing your job and create new DWGs according to parcel numbers now more easy...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 8 of 17

alaahashem
Enthusiast
Enthusiast

thanks alot 
that`s easier to do that , but I have to take one by one out to anew drawing and some time I have more than 1000 parcel ,
Is there any way ( lisp / script /what ever ....) to get parcel by number out in anew drawing automatic (take parcel number 1 out save drawing go bake take number 2 and so on...

0 Likes
Message 9 of 17

Sea-Haven
Mentor
Mentor
Accepted solution

This will take each lot out its based on the sample dwg by Ribar its step 1, step 2 is to do a script adding the title say to a layout tab and zooming to the lot. The script would be done as part of step 1 saving the text pt. 

 

(defun c:do-lots ( / obj obj2 obj1 txtstr co-ord ss ss1 ss2 fname )
(setvar 'cmdecho 0)
(setq pt (getvar 'extmax))
(setq dwgpre (getvar 'dwgprefix))
(setq obj (vlax-ename->vla-object ( car (entsel "pick lot block "))))
(setq lay (vla-get-layer obj))
(setq ss (ssget (list (cons 0 "Insert")(cons 8 lay))))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(setq txtstr (vla-get-textstring (nth 0 (vlax-invoke obj 'getattributes))))
(setq txtins (vlax-get Obj 'InsertionPoint))
(command "bpoly" txtins "")
(setq obj1 (entlast))
(command "offset" 2 obj1 pt "")
(setq obj2 (entlast))
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget obj2))))
(command "erase" obj1 obj2 "")
(setq ss1 (ssget "f" co-ord ))
(setq ss2 (ssget "wp" co-ord ))
(setq fname (strcat dwgpre txtstr ".dwg"))
(command "_.-wblock" fname "" txtins ss1 ss2 "" "n")
(command "oops")
)
(princ)
) 

 

0 Likes
Message 10 of 17

alaahashem
Enthusiast
Enthusiast

thank you very much 
it`s work well as you say 

0 Likes
Message 11 of 17

Sea-Haven
Mentor
Mentor

Testing version2 does the title block infill to each dwg.

0 Likes
Message 12 of 17

Sea-Haven
Mentor
Mentor

I am stuck your title block is an odd size what sheet do you plot onto metric or imperial ? Its nearly finished.

0 Likes
Message 13 of 17

alaahashem
Enthusiast
Enthusiast

it`s metric

0 Likes
Message 14 of 17

Sea-Haven
Mentor
Mentor

Ok will pick a metric size like A3

0 Likes
Message 15 of 17

Sea-Haven
Mentor
Mentor

Try this it works for me but the FRAME.dwg must be the one I have modified. You need to change the path to where you save the frame.dwg. It auto scales within a viewport around the lot. Start by pick 3-4 for testing its a bit slow making each dwg but will look into what is slowing it down it may be the missing fonts.

 

 

 

 

 

 

0 Likes
Message 16 of 17

alaahashem
Enthusiast
Enthusiast

thanks aloooot
,
really I dont know where the problem with me 
I change path but it doesn`t insert frame file 

0 Likes
Message 17 of 17

Sea-Haven
Mentor
Mentor

Did you use double \\ like me (write-line "-insert d:\\acadtemp\\frame.dwg 0,0 1 1 0" fo ) I did 10 at a time all ok. Did you use my Frame dwg for testing.

0 Likes