Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. EmeraldSynth

    Penn Foster Structural Drafting

    Does this look correct?
  3. (70 . 1) or (70 . 128) will filter a selection set for closed polyline - (70 . 1) is usually enough
  4. Today
  5. EmeraldSynth

    Penn Foster Structural Drafting

    So now I'm working on plate 2, same project. I'm confused on how to start this drawing... Actually I'm gonna backtrack for a minute. The last part in the instructions for plate 1 say to go to the layout tab and plot the drawing at a scale that will result in a 24" x 36" landscape plot. I've already gotten my drawing to fit inside the boundary, I've just forgotten how to see if my title block is 24x36. And is there a way to remove the lines on the drawing? It's not the grid, I've turned that off already. This is what my finished plate one looks like in model and paper space.
  6. I don't think an example drawing is needed. If you draw a rectangle using the Rectangle command, it is always closed. If you draw a rectangle (or polygon) using the Polyline command, it can be closed or open. Manually checking each rectangle (or polygon) is not very convenient... Therefore, I just wanted to add a check of polylines to the code, and if they are not closed, then close them. Сlosed-Not closed.dwg
  7. As @Saxlle says, if you post an example drawing, everything will be easier.
  8. @GLAVCVS Thank The displacement occurs, but incorrectly, some rectangles (polygons) are shifted inside, some outside. I would like not to specify the offset point, but to have the offset performed automatically - Outside. The polygons are not too irregular... Some rectangles (polygons) from polylines are not closed, so the offset does not work for them. Lee Mac's code performs the offset automatically, but does not work with unclosed rectangles (polygons).
  9. PS: 2D polylines do not support offset, so they need to be converted first. I haven't tested it extensively, but it should work for what you need.
  10. If the polygons aren't too irregular, using your own code, maybe this... (defun c:RectOffBatch (/ selset dist i ent pts maxpt offsetpt a70 es l le p1 p2 a) (prompt "\nSelect rectangles (polylines): ") (setq selset (ssget '((0 . "*POLYLINE")))) (vl-cmdf "_.CONVERTPOLY" "_Light" selset "") (if selset (progn (setq dist (getreal "\nEnter the offset distance or ENTER to indicate on screen: ")) (setq p1 (getpoint "\nPick on/near one of the rectangles to be offset...")) (if (and (setq es (car (nentselp p1))) (= (wcmatch (cdr (assoc 0 (entget es))) "LWP*"))) (progn (setq p2 (getpoint p1 "\nPoint to get direction (or distance) to offset: ")) (if (not dist) (setq dist (distance p1 p2))) (setq l (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget es)))) (setq midP (mapcar '(lambda(v) (/ v (length l))) (apply 'mapcar (cons '+ l)))) (setq a (if (> (distance p1 midP) (distance p2 midP)) 0 PI) i 0 ) (repeat (sslength selset) (setq ent (ssname selset i)) (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (setq le (entget ent))))) (if (= (rem (cdr (setq a70 (assoc 70 le))) 2) 0) (entmod (subst (cons 70 (+ (cdr a70) 1)) a70 le))) (setq maxpt (list (apply 'max (mapcar 'car pts)) (apply 'max (mapcar 'cadr pts)))) (setq midP (mapcar '(lambda(v) (/ v (length pts))) (apply 'mapcar (cons '+ pts)))) (setq offsetpt (polar (car pts) (+ a (angle (car pts) midP)) 0.01)) (command "_.OFFSET" dist ent offsetpt "") (setq i (1+ i)) ) ) ) ) ) (princ) )
  11. jim78b

    block byblock transparency

    I've already helped, you obviously didn't read my post first. I finally posted the code. Even though I work too, I found the time to do it. Happy Epiphany Day
  12. CyberAngel

    block byblock transparency

    What they're talking about, I believe, is a matter of fairness. You ask for help but provide none in return. Most of us have other commitments, but we make time to teach and to help others. Not only that, learning a bit about AutoLISP will make your work easier and faster.
  13. Clint

    Batch convert dxf to dwg

    I'll this topic a "wrap" Thanks to all here! rlx: I also have worked at my last company of fifteen years within a very locked down IT environment. Here and now, I am free! One caveat here is that there are limitations in acquiring additional Microsoft tools i.e., Power Platform tools, etc. due to the complexity introduced from being a client of an widely known commercial web hosting service. Happy, happy, happy! Clint
  14. EmeraldSynth

    Penn Foster Structural Drafting

    Okay
  15. CivilTechSource

    Viewport Inset Generator

    @tombu Yes Lee Code is perfect, if you want to stop there. But I would like to take it a step further. @BIGAL This is a different approach that might just work perfectly!
  16. Now we are talking not only about rectangles, but also polygons from LWPOLYLINE, POLYLINE. The problem is that the polygons from the LWPOLYLINE, POLYLINE must be closed. Lee Mac's OffInside.lsp code also allows offsets for CIRCLE, ARC, ELLIPSE, and SPLINE.
  17. Anything can be done, but it would be helpful if you could post an example drawing so we can see those rectangles. You can use Lee's code to perform that making a two solutions, one for inside (as it is in the example from Lee's post, and one to performe outside offset as Lee suggested).
  18. @Lee Mac thank you, that's great! Is it possible to add a check for closing polylines to the code, and if they are not closed, close them? Is it possible to combine the two codes: OffInside.lsp и CloseLwPl.lsp? (defun c:CloseLwPl (/ ss i ent edata elist obj) (prompt "Select LWPOLYLINE: ") (setq ss (ssget '((0 . "LWPOLYLINE")))) (if ss (progn (setq i 0) (repeat (sslength ss) (setq ent (ssname ss i)) (setq edata (entget ent)) (setq elist (assoc 70 edata)) (if (not (and elist (= (logand (cdr elist) 1) 1))) (progn (entmod (subst (cons 70 (logior (cdr elist) 1)) elist edata)) (entupd ent) ) ) (setq i (1+ i)) ) ) ) (princ) )
  19. rlx

    Batch convert dxf to dwg

    Their IT department even has a slogan (and I'm not kidding here) : You name it , we block it
  20. Danielm103

    Batch convert dxf to dwg

    Yikes! Working with your arms tied.. No way I could work effectively without my tools, I would at least need autohotkey. Last company I worked for, I automated their whole system, mostly because I was lazy and I wanted to eat donuts all day. AutoCAD ships with .NET, nothing to install, I would be rolling some goodies for sure. “We At ACME corporation stifle innovation by making everyone think inside the box”
  21. Yesterday
  22. rlx

    Batch convert dxf to dwg

    Even if I wanted to use a different language I wouldn't be able because at my work I'm unable to install any software that's not supplied in our software center , also certain extensions like *.bat are a big freaking no no so my dragon claws are tied in that respect. But I can get vl-some satisfaction however whenever I can create something that at first glance seems impossible to do and then come up with something that actually works.
  23. BIGAL

    Batch convert dxf to dwg

    What programming language to use ? There are so many, Lisp, Pascal, VBA, C##, now .NET, Python and of course the push product by Autodesk Dynamo but only on certain platforms. Yeah the macro record almost useless. As I have said before years ago macro record in a CAD program wrote VBA code. There is lisp2C from years ago that converted lisp code to C## code, hey Daniel what about convert lisp to Python ? The main advantage in lisp is the non compile, just run, I use code that is 30+ years old still works. Any compiled code every few years has to be recompiled to work as versions change. Dont forget how many years ago now Autodesk said VBA support would be removed, it's still there.
  24. Use this and simply switch: *dist* (- *dist*) To: (- *dist*) *dist*
  25. A couple of answers, as suggested, check is closed pline ie a rectang drawn CW or CCW then vla-offset will always go out for a CCW pline. You can do a check and reverse the pline if required. Or the simpler is (setq offsetpt (getvar 'extmax))
  26. Danielm103

    Batch convert dxf to dwg

    It’s more of, ‘pick the right tool for the right job’. In this case, ObjectARX, and by extension, Python, can provide a clean new drawing to import your DXFs into every time, whereas lisp may not. I don’t remember what all is stored in DXF, i.e. if there are things that are non-purgeable. An example is an existing text, dimension, or table style, that are named “Standard”. Nested references, Associated Styles (the text style for a dimension style). There may be user variables stored per drawing CLAYER, LTSCALE: So, using lisp DXFIN -> purge -> save on repeat may have subtle side effects. This may or may not be an issue for you
  27. Steven P

    Batch convert dxf to dwg

    For most things I do this is my default option, rarely need to do much other than that and if I do, drag and drop.
  28. I would maybe use: (vla-Offset (vlax-ename->vla-object ent) dist) where dist can be positive to go one direction, negative to go the other. This direction might also depend on the direction that the rectangle was drawn - clockwise or anticlockwise. Could do them both directions and just delete the shorter line - a few more lines of code to add though, some thinking for the first full week of work in 2026, always a quiet week. I might also suggest a couple more filters to the selection set, if all rectangles are closed polylines (test: 70 is 1 or 128 - use bitand (search for this Lee Mac uses this often to test both at the same time)), or number of vertices being 3 (closed polyline) or 4 (open polyline) (test: 90 is 3 or 4)
  1. Load more activity
×
×
  • Create New...