Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/12/2021 in all areas

  1. The issue is your use of the apostrophe to quote the ssget filter list as a literal list, resulting in the radius variable being intrepreted as a symbol rather than being evaluated to yield the value that the variable has been assigned. I would strongly suggest reading my tutorial on The Apostrophe and the Quote Function to understand why this issue arises, and how to solve it.
    2 points
  2. @lastknownuserThis is probably the simplest. If you keep creating hatches they will never equal until you set through the loop without creating a new hatch. Found in a Lee Mac post 10 years ago. (setq LastEntity T) (while (not (equal LastEntity ThisEntity)) (setq LastEntity (entlast)) (command "-hatch" "P" "S" "CO" "" pause "") (setq ThisEntity (entlast)) ) -EDIT- Forgot the first line. without it they would both be nil at the start.
    1 point
  3. Have many appies that are doing great but if I ever have to change anything probably better to start from scratch. That's why I often use many subfunctions so I only have to take that part out and replace it with a better version. In your case you may want to make a subfunction that can find the midpoint between 2 parallel (poly)lines , taking in account general spacing if this is known and angle of the lines / polyline segments. Just using one of the standard AutoCad (M)leader styles would also get you a long way. But I understand , nobody wants to kick out their 'baby' they have nurtured for so long...
    1 point
  4. No particular reason, I just fancied a change
    1 point
  5. (defun C:test(/ i ss) (vl-load-com) (setvar "cmdecho" 0) (if (setq ss (ssget "X" '((0 . "DIMENSION") (-3 ("ACAD"))))) (repeat (setq i (sslength ss)) (entmod (list (cons -1 (ssname ss (setq i (1- i)))) (list -3 (list "ACAD")))) ) (if (setq ss (ssget "X" '((0 . "DIMENSION") (-4 . "<AND")(-4 . "<NOT")(1 . "")(-4 . "NOT>")(-4 . "<NOT")(1 . "*<>*")(-4 . "NOT>")(-4 . "AND>")))) (repeat (setq i (sslength ss)) (PROGN (setq iOG(vlax-ename->vla-object (ssname ss (setq i (1- i))))) (vlax-put-property iOG "textcolor" 1) (vlax-put-property iOG 'TextFill :vlax-true) (vlax-put-property iOG 'TextFillColor 2) ) ) (alert "Not find Edited Dimensions!") ) ) (princ) )
    1 point
  6. You'll need to add this to the code to even get it to run: (setq {acadapp} (vlax-get-acad-object) {acaddoc} (vla-get-activedocument {acadapp}) {modelspace} (vla-get-modelspace {acaddoc}) ) Why have you chosen dimensions like this for these callouts ? It's a bit busy IMO. Maybe use mleaders then you can use mleaderalign to line them up ?
    1 point
  7. Your code is probably too complex for us mortals , well it is for me , there I said it... Still it's impressive even if it's not stable (yet). Looks like the leader part itself is working but the circle part is not. Maybe you could try to use ssget with 2-point fence instead of crossing , once with polar 0 degrees and once polar 0.5pi and then someting like vla-intersectWith , find midpoint between intersection. (don't think I have ever programmed something with vla-intersectWith myself or maybe I have but Altzheimer) Anyways , maybe create a better / simpler test environment with very simple squares where all coordinates are known , and print or place breakpoint / watch for all values and coordinates so you know exactly what values you should expect to see. And once you got this working move on to more complex figures. I expected more response for your thread so maybe my reaction triggers more (/ more intelligent) people to have a look at your code because I think its worth it. I know I have seen something simular on this site but can't find it. Dont know the right english words to search for , markers , leaders with circle, autonumber parts? hope you will get more reactions but sometimes its very hard to follow someone elses code / thoughts / logic you know , hell I sometimes have trouble deciphering my own code after a while. Good luck.
    1 point
  8. I think you need vla-AddDimArc instead of vla-adddimaligned, when the pline segment has a bulge. With entity data you can check group code 42 (below where not 0.0), but I don't know how to do that with vla (-1 . <Entity name: 4f149780>) (0 . "LWPOLYLINE") (5 . "394C7") (330 . <Entity name: 5388b2a0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "A-Anno-Dims") (100 . "AcDbPolyline") (90 . 3) (70 . 1) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 4356.84804203341 350.624586629363) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 4406.20408925404 379.348187880717) (40 . 0.0) (41 . 0.0) (42 . 0.442890086327557) (91 . 0) (10 4343.90219358209 394.721382916653) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0 1.0)
    1 point
×
×
  • Create New...