Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Hi, many thanks for your help Aridzv and BigAl, But, all entities are being converted to layer "site". The ones inside the pline are not being moved to layer "exist" I'm attaching the drawing on which I am testing. surveytest.dwg
  3. BIGAL

    Hybrid parallel

    "Plines in same direction", Yes Lee-Mac has a method also. Note the use of Pedit as Bricscad does not have a "Reverse" command, as at V25. ; Checking if pline is CW or CCW and set to CCW ; Orignal idea by Kent Cooper, 1 August 2018 Offsetinorout.lsp ; By Alan H July 2020 (defun AH:chkcwccw (ent / objnew area1 area2 obj minpoint maxpoint) (setq obj (vlax-ename->vla-object ent)) (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) (setq dist (/ (distance pointmin pointmax) 20.0)) (vla-offset obj dist) (setq objnew (vlax-ename->vla-object (entlast))) (setq area1 (vlax-get objnew 'Area)) (vla-delete objnew) (vla-offset obj (- dist)) (setq objnew (vlax-ename->vla-object (entlast))) (setq area2 (vlax-get objnew 'Area)) (vla-delete objnew) (if (> area1 area2) (command "Pedit" ent "R" "") ) (princ) ) (defun c:CWCCW ( / *error* x ent oldsnap doc ss) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark doc) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (prompt (strcat "\nSelect Plines to check")) (if (setq ss (ssget '((0 . "*POLYLINE")))) (progn (repeat (setq x (sslength ss)) (setq ent (ssname ss (setq x (- x 1)))) (AH:chkcwccw ent) ) ) ) (vla-endundomark doc) (alert (strcat (rtos y 2 0) " Plines reversed")) (setvar 'osmode oldsnap) (princ) ) (vl-load-com) (prompt "\nType CWCCW to set plines to CCW") (c:CWCCW)
  4. Yesterday
  5. PGia

    Hybrid parallel

    I’m sorry. I didn’t think this was important — but maybe I was wrong. I usually copy drawings from my PC to edit them on my smartphone. The app I use on my smartphone is DWG FastView. I don’t remember where I sent it from, but if that message appeared when opening it, it must be because I saved the drawing on my smartphone for some reason and sent it from there.
  6. Steven P

    Hybrid parallel

    I think Lee Mac had something to work out polyline direction, so should be able to check and reverse a polyline if necessary. Reverse back again after
  7. SLW210

    Hybrid parallel

    From what I have gathered, no easy task to do this, many GIS programs seem to struggle with pinpoint accuracy as well. The method for QGIS, is involved, so I didn't get time to run through it with the plugin, but I did dig into reddit and some GIS sites. Basically they do similar method, they just add a lot of points down the "polyline/line" and run the appropriate "centerline tool". Where someone posted results, I saw some in some of them the same "off center through some areas" as in the methods posted here. This was apparently plenty good enough for most GIS users, though I only did a relatively quick dig. In a similar method for AutoCAD, maybe adding more points to the polylines would help. I might have time Monday at home to check QGIS. Though I did import the OPs drawings into a session, the first one comes in very strange, the second seemed to be correct. The OP still hasn't answered why the second .dwg posted comes up as not an AutoCAD drawing. For AutoCAD, it helps if BOTH polylines go the same direction.
  8. My $0.05 does not check for off or frozen layers. (defun c:wow ( / ent co-ord ss) (if (tblsearch "layer" "Site") (princ) (command "-layer" "Make" "Site" "c" 1 "" "") ) (if (tblsearch "layer" "Exist") (princ) (command "-layer" "Make" "Exist" "c" 2 "" "") ) (command "chprop" "all" "" "la" "Site" "") (setq ent (car (entsel "\nPick the pline "))) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent)))) (setq ss (ssget "WP" Co-ord)) (command "chprop" ss "" "LA" "Exist" "") (princ) ) (c:wow)
  9. Last week
  10. mhupp

    Hybrid parallel

    I Created a closed polyline and offsetting in. the smaller the offset the more "detail" (points) you get but you need them to get the right vertex or you just cutting corners. I don't really know how to pick up those points and don't really want to offset 1cm and have a million points either. CPL offset.dxf
  11. see new code. make sure the layers names are correct. (defun c:chglyobjpl (/ acdoc p_list p_coord sset ent obj newLayerName newLayerName1 i) (vl-load-com) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (princ "\nSelect All Objects To Proccess") (setq ssall (ssget)) (setq p_list (entget (car (entsel "\nSelect the Polyline Boundery For ''exist'' Layer: ")))) (setq i 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;Change Objects To site Layer;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if ssall (progn (sssetfirst nil nil) (setq newLayerName1 "site");;(getstring T "\nEnter new layer name: ")) (repeat (setq i (sslength ssall)) (setq i (1- i)) (setq ent (ssname ssall i)) (setq obj (vlax-ename->vla-object ent)) (vla-put-Layer obj newLayerName1) );;repeat (vla-Regen acdoc acAllViewports) (sssetfirst nil nil) );;progn (princ "\nNo objects found in the drawing.") );;if ;;;;;;;;;;;;;;;;;;;;;;;;;;;Change Objects To site Layer;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq ent nil) (setq obj nil) (setq i 0) ;;;;;;;;;;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-using-existing-polygon/td-p/11307274 ;;;;;;;;;;;calderg1000 msg-7 (if (setq p_coord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) p_list) );;end setq p_coord );;end if condition (sssetfirst nil (setq sset (ssget "_wp" p_coord))) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;Select Objects In polygon;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;Change Objects Layer;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if sset (progn (sssetfirst nil nil) (setq newLayerName "exist");;(getstring T "\nEnter new layer name: ")) (repeat (setq i (sslength sset)) (setq i (1- i)) (setq ent (ssname sset i)) (setq obj (vlax-ename->vla-object ent)) (vla-put-Layer obj newLayerName) );;repeat (vla-Regen acdoc acAllViewports) (sssetfirst nil nil) );;progn (princ "\nNo objects found in the drawing.") );;if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;Change Objects To exist Layer;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (sssetfirst nil nil) (princ) );;end defun test1.mp4
  12. Thanks ... but..... on running the program, its saying that "no objects found in the drawing" and the program closes
  13. I used the lisp called cookie cutter .. it worked like magic thank you SLW210
  14. Try this: (defun c:chglyobjpl (/ acdoc p_list p_coord sset ent obj newLayerName i) (vl-load-com) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) ;;;;;;;;;;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-using-existing-polygon/td-p/11307274 ;;;;;;;;;;;calderg1000 msg-7 (setq p_list (entget (car (entsel "\nSelect the LwPolyline: ")))) (if (setq p_coord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) p_list) );;end setq p_coord );;end if condition (sssetfirst nil (setq sset (ssget "_wp" p_coord))) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;Select Objects In polygon;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;Change Objects Layer;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if sset (progn (setq newLayerName "exist") ;;(getstring T "\nEnter new layer name: ")) (repeat (setq i (sslength sset)) (setq i (1- i)) (setq ent (ssname sset i)) (setq obj (vlax-ename->vla-object ent)) (vla-put-Layer obj newLayerName) );;repeat (vla-Regen acdoc acAllViewports) (sssetfirst nil nil) );;progn (princ "\nNo objects found in the drawing.") );;if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;Change Objects Layer;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (princ) );;end defun
  15. If you want to have a go, look at Selection Sets to select everything within the polyline (see Lee Mac Selection sets page - it is rather good - ssget), window polygon or crossing polygon Do 2 selection sets - one for everything "_X" and one for Crossing Polygon, I think Lee Mac has a routine there to remove one selection set from another. This gives you 2 sets of entities to work with Loads of LISPs out there to change layers. Have a go, it is easier than you might think
  16. Hi, Is there a Lisp routine which can move all objects within a selected polyline to a layer called "exist" and all objects outside that same polyline to a layer called "site" ?? ignoring all frozen or OFF layers ?? Regards.
  17. This is very much proof of concept, and needs some extra work but you can try it. I just did 162 layouts by selection did not try all 300+. You must use this new dwg as it has Layout1 set up correctly. I removed layout2 not needed. Obvious bug is if rectangs are not made in correct label sequence but can fix that if it happens. It uses creation order at moment. You should use 1 size for all the rectangs. ; https://www.cadtutor.net/forum/topic/98809-multiple-polyline-viewport-from-model-to-layout/ ; rectangs to layouts by AlanH ; Nov 2025 (defun rec2lays ( / ss ent txt ins pt2 pts ent2 co-ord mp ) (setvar 'ctab "Model") (setq ss (ssget (list (cons 0 "*TEXT") (cons 8 "SHEMA_NAME")(cons 410 "Model")))) (repeat (setq x (sslength ss)) (setq ent (entget (ssname ss (setq x (1- x))))) (setq txt (cdr (assoc 1 ent))) (setq ins (cdr (assoc 10 ent))) (setq pt2 (polar ins 5.4977 2.5)) (setq pts (list ins pt2)) (setq ent2 (ssname (ssget "F" pts (list (cons 0 "LWPOLYLINE")(cons 8 "SHEMA_RECT"))) 0)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent2)))) (setq mp (mapcar '* (mapcar '+ (car co-ord) (caddr co-ord)) '(0.5 0.5))) (command "layout" "C" "Layout1" txt) (setvar 'ctab txt) (command "Mspace") (command "zoom" "c" mp 10) (command "zoom" "15XP") ; a custom scale of 15 seems to suit (command "Pspace") (setvar 'ctab "Model") ) (princ) ) sheme_JAS.dwg
  18. So... what you need to create is a top, front and side view as well as a sectional view in 2D. Have you done anything like that in the past?
  19. As suggested can be done you would look for the "Mx" value then find the co-ords of the rectang, make a layout and create a viewport. You need to provide a couple of things, it would be best to have 1 true size title block in say "Layout1" this would be copied repeatedly. If you dont use a title block ignore. Part 2 as already requested you need to set one size for the layouts. Say a A4 etc. The rectangs are different sizes you need to set the size to match the biggest rectang say M15 as example then a proper scale can be used for the viewport. The layouts are then consistent. So get something like this at a fixed scale.
  20. Steven P

    Text to polyline length

    Thanks, though it can be improved a bit too - I reckon the point of intersections would be better off on the lines between height points - tried that just now but got myhead going round in circles with a part of it. Will see what I can do for later
  21. PaulyPHI

    Text to polyline length

    @Steven P that works way better than i dreamed... even if you say its a bit dirty... Being able to select the intersection of datum and reference line, and the scaling option is brilliant.. If i had a box of Jaffa Cakes they would be in your hands right now.... Thank you soo much.... @BIGAL thank you for the reply and i think i understand what you mean... but i need to leave some work for my understudy to do can't speed him up too much.....
  22. GLAVCVS

    Hybrid parallel

    Yes. My "one/cross-eyed" son has quite a few limitations: he only sees reality from one point of view. But reality is best analyzed in "Stereo." For the same reason, I think we need to analyze both polylines in the same way and at the same time (using angle bisectors). I hope to have time to make progress on my "good approach" next weekend. Someone has "travelled very far" in experimenting with this type of calculation: @marko_ribar I think it would be very interesting to hear his opinion on this.
  23. Do you have a desired layout format (paper size), desired scale, etc. or you just want to display of each viewport from model space no matter the scale, paper size, etc.?
  24. Thank s for answer. Here is my case . In this drawing need to create 355 viewports in ONE layout paperspace. The rectangul of viewport is on layer "SHEMA_RECT". sheme_JAS.dwg
  25. BIGAL

    Blocks and library

    As I have said many times I use POP menus for block libraries, you can select internal or external blocks for insertion. Pop menus should be fine in LT even earlier versions.
  26. Yes like many others as suggetsed @aridzv I have something, and have made like 50+ in one go. You need to post a sample dwg to see how you are attempting to do this.
  27. BIGAL

    Text to polyline length

    If you break down the top surface and convert it into a single Pline, Then you can label every point into a cross section shape. You would need to say set the RL of the 1st point enter Hor and Ver scales if applicable. Draw a datum line then can put text below it. There is 2 levels at some points but that can be taken into account. So maybe post a few cleaned up version of the SINGLE plines.
  28. I have just created a load of blocks for future use, they where in the block panel, but have now disappeared? is thewre a tutorial for creating a block library. Using 2026LT
  1. Load more activity
×
×
  • Create New...