autodim-dimangular-problem

autodim-dimangular-problem

marko_ribar
Advisor Advisor
857 Views
5 Replies
Message 1 of 6

autodim-dimangular-problem

marko_ribar
Advisor
Advisor

Hi all,

I have problem with "dimangular" auto dimensioning...

Have a look at picture...

I wrote "autodim.lsp" posted here : https://www.cadtutor.net/forum/files/file/54-autodimlsp/ 

and when I tried to apply it on closed straight-arced lwpolyline, dimangular almost finished correctly the task, but on one portion of arced segment it didn't measured angle bigged than 180 degree...

My question is, can this be fixed to work as desired... I'll attach picture and *.DWG... *.lsp can be downloaded from link I provided at cadtutor download section...

Thanks, M.R.

 

autodim-dimang-problem.png

 

 

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Accepted solutions (1)
858 Views
5 Replies
Replies (5)
Message 2 of 6

marko_ribar
Advisor
Advisor

I haven't noticed, but on 2 places it didn't processed dimangular... I managed to add those manually, but now I have overlapping of dimradial with dimangular... That one with bigger angle than 180 degree I somehow manually managed to fix... So, all I can tell is that my code is buggy... Can someone see and try to fix lacks... I'll post here another picture and corresponding *.dwg...

 

autodim-dimang-problem-another.png

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

CodeDing
Mentor
Mentor

@marko_ribar ,

 

You need to change your method from...

(vla-adddimangular ...)

...to...

(vla-adddim3pointangular ...)

 

[you can keep your same input parameters]

It's a different method for adding the angular type of dimension.

Reference here:

https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-16DBF5D3-5D7B-4302-9363-43827C9ACFDF 

 

Best,

~DD

Message 4 of 6

CodeDing
Mentor
Mentor

Also,

 

When I run your code, my linear dims show up INSIDE the shape, where your show up outside. Not sure if that's worth looking into or not, but cool routine!

image.png

Message 5 of 6

CodeDing
Mentor
Mentor
Accepted solution

@marko_ribar ,

 

To your Second issue, you need to add a dimangular dimension inside the "true" condition of your IF statement:

        (if (< (distance c p1) (distance c (trans (vlax-curve-getclosestpointto lwi p1) 0 1)))
          (progn
            (vla-adddimarc spc (vlax-3d-point c) (vlax-3d-point p1) (vlax-3d-point p3) (vlax-3d-point (polar p2 (angle p2 c) d)))
            ;; vvv You are missing this line of code vvv
            (setq dimang (vla-adddim3pointangular spc (vlax-3d-point c) (vlax-3d-point p1) (vlax-3d-point p3) (vlax-3d-point (polar p2 (angle p2 c) (* 3.0 d)))))
            ;; ^^^ You are missing this line of code ^^^
            (setq dimrad (vla-adddimradial spc (vlax-3d-point c) (vlax-3d-point pp) (* 2.0 d)))
            (vla-put-textposition dimrad (vlax-3d-point (polar pp (angle pp c) (* 2.0 d))))
          )
          (progn
            (vla-adddimarc spc (vlax-3d-point c) (vlax-3d-point p1) (vlax-3d-point p3) (vlax-3d-point (polar p2 (angle c p2) d)))
            (setq dimang (vla-adddim3pointangular spc (vlax-3d-point c) (vlax-3d-point p1) (vlax-3d-point p3) (vlax-3d-point (polar p2 (angle c p2) (* 3.0 d)))))
            (setq dimrad (vla-adddimradial spc (vlax-3d-point c) (vlax-3d-point pp) (* 5.0 d)))
            (vla-put-textposition dimrad (vlax-3d-point (polar pp (angle c pp) (* 5.0 d))))
          )
        )

 

Message 6 of 6

marko_ribar
Advisor
Advisor

I haven't tested it yet, but I believe you are right... So I copied code snippet in my routine and reuploaded it at cadtutor...

Marko Ribar, d.i.a. (graduated engineer of architecture)