Author Topic: Please break my routine......  (Read 10405 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1443
Please break my routine......
« on: March 18, 2014, 11:58:47 AM »
I have completely overhauled the routine that we use to draw leaders here, but before I release it to my users, I was wondering if anyone here might be willing to kick the tires and see if they can break it?

The Uleader command  (UL is a shortcut) can be used to draw leaders, modify existing leaders or align leaders.

The MLP command can be used to make leaders parallel.

The L2M command can be used to convert Qleaders or lines and text (or blocks) to mLeaders.

Please note that the mleaders.dwg has to be in a location that is listed in your support files.

EDIT: Updated routine to 3.0c to add various fixes, clearer prompts and an exit option.
EDIT: Updated routine to 3.0d to fix exit option
EDIT: Updated routine to 3.0F - But the modify option resets one  of the points to 0,0 for some reason.
EDIT: Updated routine to 3.0h - Fixes the bug in 3.0F
EDIT: Updated routine to 3.0i - Restores compatibility with versions 2014 and lower by using DDEDIT in these versions and TEXTEDIT in 2015
« Last Edit: March 27, 2014, 01:15:27 PM by cmwade77 »

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Please break my routine......
« Reply #1 on: March 18, 2014, 12:40:39 PM »
Type UL and hit escape.

Edit *error* to have this:
Code: [Select]
(if mlObj (vla-highlight mlObj :vlax-false))
instead of
Code: [Select]
(vla-highlight mlObj :vlax-false)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #2 on: March 18, 2014, 01:55:28 PM »
Thank you Alan, I fixed this....looking forward to seeing what others come up with.

PKENEWELL

  • Bull Frog
  • Posts: 320
Re: Please break my routine......
« Reply #3 on: March 18, 2014, 05:29:10 PM »
(AutoCAD Mechanical 2014 - 64 bit)

I get an error when using the "S" option, then selecting an existing leader and using the "A" option to change the arrow head.

Code: [Select]
Command: UL
Pick starting point of leader [Select leader to change or align]: S

Select leader to align [Multiple/** alignX **/alignY/** alignangLe **/Note/Typ/Poc(d)/cIvil/Arrowheads/Content]: A
** Error: bad argument type: 2D/3D point: 13 **

The arrow head changes, then the program crashes with the above error.

FYI - I am using the program from within the "uleader.dwg" file
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt

trogg

  • Bull Frog
  • Posts: 255
Re: Please break my routine......
« Reply #4 on: March 18, 2014, 07:36:58 PM »
Chris,
This is very cool. I enjoy testing new stuff like this.

I noticed a couple of things:
1) After placing to leaders created by the routine's default settings, I wanted to try to align the 2 when the landings are on opposite sides of the text.
After starting the tool by using the UL command, I select the leader that will be aligned (according to the prompt in Picture 1)
Then The prompt stays the same but obviously it recognized the first selection because it highlights the first leader, so I select the 2nd leader that I want the first to be aligned to (picture 2).
Results in picture 3.
I was expecting the first leader to aligned to the second and that didn't happen, so maybe the prompts can be edited to be more clear.
Also note that when the leader is on different sides of the text, that the direction is retained. I actually don't think that this is a problem since I have needed this to be the desired result of an MLeader.
I don't know anything about the complexity of programming MLeaders so I don't know if making an option for when this situation arises so that there is a choice of which side the leader comes from is a real possibility.

Great job Chris
~Greg
« Last Edit: March 18, 2014, 07:47:33 PM by trogg »

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #5 on: March 18, 2014, 07:49:38 PM »
(AutoCAD Mechanical 2014 - 64 bit)

I get an error when using the "S" option, then selecting an existing leader and using the "A" option to change the arrow head.

Code: [Select]
Command: UL
Pick starting point of leader [Select leader to change or align]: S

Select leader to align [Multiple/** alignX **/alignY/** alignangLe **/Note/Typ/Poc(d)/cIvil/Arrowheads/Content]: A
** Error: bad argument type: 2D/3D point: 13 **

The arrow head changes, then the program crashes with the above error.

FYI - I am using the program from within the "uleader.dwg" file

It's not designed to work within the uleader.dwg file. That is a supporting file that contains all of the mleader styles, as they are near impossible to create via LISP. There are all sorts of odd errors that happen when running from within the uleader.dwg file, because when you load the program, it partially inserts that file as a block.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #6 on: March 18, 2014, 07:53:52 PM »
Chris,
This is very cool. I enjoy testing new stuff like this.

I noticed a couple of things:
1) After placing to leaders created by the routine's default settings, I wanted to try to align the 2 when the landings are on opposite sides of the text.
After starting the tool by using the UL command, I select the leader that will be aligned (according to the prompt in Picture 1)
Then The prompt stays the same but obviously it recognized the first selection because it highlights the first leader, so I select the 2nd leader that I want the first to be aligned to (picture 2).
Results in picture 3.
I was expecting the first leader to aligned to the second and that didn't happen, so maybe the prompts can be edited to be more clear.
Also note that when the leader is on different sides of the text, that the direction is retained. I actually don't think that this is a problem since I have needed this to be the desired result of an MLeader.
I don't know anything about the complexity of programming MLeaders so I don't know if making an option for when this situation arises so that there is a choice of which side the leader comes from is a real possibility.

Great job Chris
~Greg

The prompts are correct, the results are not, so that is a bug that I need to resolve.

PKENEWELL

  • Bull Frog
  • Posts: 320
Re: Please break my routine......
« Reply #7 on: March 19, 2014, 11:35:47 AM »
It's not designed to work within the uleader.dwg file. That is a supporting file that contains all of the mleader styles, as they are near impossible to create via LISP. There are all sorts of odd errors that happen when running from within the uleader.dwg file, because when you load the program, it partially inserts that file as a block.

I realized that after posting. Tried it again in a new drawing and its working. Only thing I noticed upon testing this morning was the program does not exit cleanly; after exiting the command line shows 'Unknown command "UL".' looks like there is problem with the code line:
Code: [Select]
(COMMAND "._TEXTEDIT" (ENTLAST) "")I don't think the last return is needed - at least not in AutoCAD 2014. You may want to cover your bases by making it like this:
Code: [Select]
(COMMAND "._TEXTEDIT" (ENTLAST))(while (not (equal (getvar "cmdnames") ""))(command ""))
EDIT: I also notice that when using the "S" option to align leaders:
1) It's difficult to understand what your aligning to what; the prompts need to be more explanitory.
2) After you align the 1st leader the command line is put into an endless loop and there is no option to exit, either by using ENTER or a key word, like "eXit" or something. The only way to exit is by hitting ESC, which brings up a console break error.
« Last Edit: March 19, 2014, 11:52:14 AM by PKENEWELL »
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #8 on: March 19, 2014, 12:45:34 PM »
It's not designed to work within the uleader.dwg file. That is a supporting file that contains all of the mleader styles, as they are near impossible to create via LISP. There are all sorts of odd errors that happen when running from within the uleader.dwg file, because when you load the program, it partially inserts that file as a block.

I realized that after posting. Tried it again in a new drawing and its working. Only thing I noticed upon testing this morning was the program does not exit cleanly; after exiting the command line shows 'Unknown command "UL".' looks like there is problem with the code line:
Code: [Select]
(COMMAND "._TEXTEDIT" (ENTLAST) "")I don't think the last return is needed - at least not in AutoCAD 2014. You may want to cover your bases by making it like this:
Code: [Select]
(COMMAND "._TEXTEDIT" (ENTLAST))(while (not (equal (getvar "cmdnames") ""))(command ""))
EDIT: I also notice that when using the "S" option to align leaders:
1) It's difficult to understand what your aligning to what; the prompts need to be more explanitory.
2) After you align the 1st leader the command line is put into an endless loop and there is no option to exit, either by using ENTER or a key word, like "eXit" or something. The only way to exit is by hitting ESC, which brings up a console break error.

All very valid points, thank you. And I was trying to figure out why it was giving me that error. I was previously using DDEDIT, which did require the return, but since that command may go away in future releases, I thought I should change it to the newer textedit command.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #9 on: March 20, 2014, 07:07:51 PM »
I have updated the first post to a newer version that hopefully clarifies the prompts (although I am wondering now if I can come up with a way to do a live preview instead), adds an exit option and fixes various bugs that are listed here and that I have found as well.

PKENEWELL

  • Bull Frog
  • Posts: 320
Re: Please break my routine......
« Reply #10 on: March 21, 2014, 12:50:14 PM »
I have updated the first post to a newer version that hopefully clarifies the prompts (although I am wondering now if I can come up with a way to do a live preview instead), adds an exit option and fixes various bugs that are listed here and that I have found as well.

Did another test a bit ago. First thing I noticed is when using the "S" option to align leaders. On the menu you have 2 options that have the same Capital in the Keyword:

Select leader that is to be aligned [Multiple/alignX/** alignY **/** alignangLe **/Note/Typ/Poc(d)/Arrowheads/eXit]:

If you try to switch back to "AlignX" option, program "eXit"s instead. Maybe use "E" for exit, instead of "X"?
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #11 on: March 21, 2014, 05:34:04 PM »
I have updated the first post to a newer version that hopefully clarifies the prompts (although I am wondering now if I can come up with a way to do a live preview instead), adds an exit option and fixes various bugs that are listed here and that I have found as well.

Did another test a bit ago. First thing I noticed is when using the "S" option to align leaders. On the menu you have 2 options that have the same Capital in the Keyword:

Select leader that is to be aligned [Multiple/alignX/** alignY **/** alignangLe **/Note/Typ/Poc(d)/Arrowheads/eXit]:

If you try to switch back to "AlignX" option, program "eXit"s instead. Maybe use "E" for exit, instead of "X"?
Yes, good catch....grr.....I'll get it one of these days.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Please break my routine......
« Reply #12 on: March 25, 2014, 01:12:00 PM »
I have updated the first post to a newer version that hopefully clarifies the prompts (although I am wondering now if I can come up with a way to do a live preview instead), adds an exit option and fixes various bugs that are listed here and that I have found as well.

Did another test a bit ago. First thing I noticed is when using the "S" option to align leaders. On the menu you have 2 options that have the same Capital in the Keyword:

Select leader that is to be aligned [Multiple/alignX/** alignY **/** alignangLe **/Note/Typ/Poc(d)/Arrowheads/eXit]:

If you try to switch back to "AlignX" option, program "eXit"s instead. Maybe use "E" for exit, instead of "X"?
I have modified the original post to update to the E for exit option.

ribarm

  • Gator
  • Posts: 3297
  • Marko Ribar, architect
Re: Please break my routine......
« Reply #13 on: March 26, 2014, 07:48:55 AM »
cmwade77, I've modified your version 3.0d to 3.0e... I did find that when leader is to be modified after creating one, and if you then choose twice "P" option then you choose again "P", routine will fail because original VLA-OBJECT definition was destroyed when changing BlockContentType, so I couldn't escape doing copybase, pasteclip variant in my revision as I couldn't get correct VLA-OBJECT definitions in some other way... It isn't such a big deal, user can't even register when mlobj VLA-OBJECT was switched and further more now option "C" is working in the same manner as "P" option... You can cycle in modify mode of c:uleader all the time you want - it won't break, and when you wish to exit there is now your new "E" option...

Please, verify that my mods are useful...
M.R.
« Last Edit: March 27, 2014, 05:54:33 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3297
  • Marko Ribar, architect
Re: Please break my routine......
« Reply #14 on: March 26, 2014, 07:12:07 PM »
I've revised 3.0e version once more... Thanks for your patience, you can download now...

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

:)

M.R. on Youtube