ACAD 2022 Getangle Mid-Command Issues

ACAD 2022 Getangle Mid-Command Issues

disbell
Explorer Explorer
719 Views
5 Replies
Message 1 of 6

ACAD 2022 Getangle Mid-Command Issues

disbell
Explorer
Explorer

I just upgraded from AutoCAD 2020 to AutoCAD 2022 & loaded my customization files, & tested a few custom commands to make sure they loaded properly. In short one of them isn't working correctly. I did some troubleshooting & ended up writing a much shorter version to narrow down the issue. This is the simplified command:

 

(defun c:dro2 ()
  (princ "\nDRO Simplified Test\n")
  (command ".dimlinear" pause pause)
  (princ "\nSpecify angle for setq: ")
  (setq ang1 (getangle))
  (command "r" (* ang1 (/ 180 pi)))
  (princ)
)

 

 When I run this in AutoCAD 2020 (or Advance Steel 2021), I get my expected outcome. I'm able to select 2 points to locate the dimension. Then I'm able to select 2 more points for the angle. At the end, I can place my dimension.
When I run this in AutoCAD 2022, I pick my first 2 points normally, but when I try to select the points for the angle, my cursor disappears completely. I cannot see where I've picked, & have no idea whether osnaps are even active. Once I pick those 2 points, things seem to return to normal.

I looked & didn't find any mention of lsp changes in 2022, so I'm assuming this is a bug, but I'm not sure. My original full code stores this angle selection for repeat use as well as handling layer selection & error control. I'd rather not give up that functionality. Can anyone else confirm if this happens for them as well? I have some ideas for rewriting the command to avoid the issue, but I'm not sure what other issues I'll create or where else this type of issue is going to appear.

0 Likes
720 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

I don't have 2022 yet, but I'm wondering whether you wouldn't be better off using the DIMROTATED command, rather than the DIMLINEAR command [which by default does them horizontally or vertically] and forcing a rotation angle with the option.  DIMROTATED is built for this kind of thing.  Something like:

 

(command "_.dimrotated"

  (angtos (setq ang1 (getangle "\nSpecify angle for setq: ")) (getvar 'aunits) 8 )

  pause pause ; the two definition points

); leave you at positioning dimension line

 

[If the positioning of the dimension line doesn't involve setting the picked location as a variable or something, you may as well just include a third pause for it within the (command) function, rather than conclude the (command) function and leave you to position the dimension line outside it.]

Kent Cooper, AIA
Message 3 of 6

disbell
Explorer
Explorer

Kent, I was not aware that the DIMROTATED command existed before now. I'm not sure yet whether it will work better for my purposes, but I'm glad to know it is something to work with. Thanks for that. If it remembered the last used angle, it would really simplify things. Sadly, it doesn't seem to. I may just rewrite it to save positions & angles as variables & then feed them into either DIMLINEAR or DIMROTATED as a workaround for the time being.

I am using the angle variable to store it for repeat use, as I generally place more than one dimension in a string. My full code includes layer automation, undo start & end points, & error correction as well.

I've started a support ticket with Autodesk. It looks like there was a patch released last week for similar issues. Downloading the patch did not fix the initial issue for me, so they are escalating it. I'm hoping it's resolved in a patch soon.

0 Likes
Message 4 of 6

ronjonp
Mentor
Mentor

This looks similar to the problem HERE. Graphics not updating within command calls.

Message 5 of 6

disbell
Explorer
Explorer

ronjonp, yes, that does seem to be the same type of problem. I looked at that thread before making this one, but didn't fully understand what was being discussed at the time.

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

@disbell wrote:

.... I am using the angle variable to store it for repeat use, as I generally place more than one dimension in a string. ....


Look into using DIMROTATED followed by DIMCONTINUE.

Kent Cooper, AIA
0 Likes