Author Topic: Rookie Button Macro Issue: Linetype Loading  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

chilldaddy

  • Guest
Rookie Button Macro Issue: Linetype Loading
« on: April 04, 2024, 11:01:46 AM »
GOAL: Create a button macro to load the DASHED linetype to the active file.  :smitten:

Button macro insights on limitations and assistance in correcting the code below is appreciated.

^C^C-LINETYPE;L;DASHED;

ISSUE 1: The macro stalls at LIN file selection dialog box (the current selection is and is desired to be the DEFAULT.LIN file.)  :tickedoff:

ISSUE 2: If the DASHED linetype is already loaded, is there a method to code the button macro so it does not stall at the RELOAD Y/N prompt?  :uglystupid2:
« Last Edit: April 04, 2024, 11:28:45 AM by chilldaddy »

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #1 on: April 04, 2024, 11:56:58 AM »
You mean ACAD.LIN or ACADISO.LIN...
And for loading I suggest to load them all in template DWG... To load them all just specify "*" (without quotes) when asked for linetype name...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

PKENEWELL

  • Bull Frog
  • Posts: 319
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #2 on: April 04, 2024, 12:09:56 PM »
GOAL: Create a button macro to load the DASHED linetype to the active file.  :smitten:

Button macro insights on limitations and assistance in correcting the code below is appreciated.

^C^C-LINETYPE;L;DASHED;

ISSUE 1: The macro stalls at LIN file selection dialog box (the current selection is and is desired to be the DEFAULT.LIN file.)  :tickedoff:

ISSUE 2: If the DASHED linetype is already loaded, is there a method to code the button macro so it does not stall at the RELOAD Y/N prompt?  :uglystupid2:

Issue 1): You will have to set the FILEDIA to 0 before using the command line version in a macro, or it will bring up the file dialog. (if you use the solution in #2, then you won't have to do this.)

Issue 2): unfortunately, you will have to resort to using a bit of autoLISP to check for something already loaded. Something like this in your macro:
Code - Auto/Visual Lisp: [Select]
  1. ^C^C(progn (command "._-Linetype" "_L" "DASHED" "") (if (tblsearch "LTYPE" "DASHED")(command "_Y"))(command ""))
  2.  
"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

CEHill

  • Mosquito
  • Posts: 15
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #3 on: April 04, 2024, 12:37:20 PM »
The newbie previously known as chilldaddy is now CEHILL.

At any rate with pride set aside, "both of the above" appreciate your comments and code snippets provided.

My design world now consists of interaction with that other DWG software: It really likes the default naming. So, it's correct.

C.


JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #4 on: April 04, 2024, 12:42:54 PM »
Having two profiles is not allowed (why didn't you just change your profile name instead of creating a new profile?!). ...I will be deleting one of your profiles; choose which one you want to keep.

Also, why are you posting macro type questions to a Lisp forum? Wouldn't "CAD General" be a better spot for general cad questions?
[ https://www.theswamp.org/index.php?board=5.0 ]
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CEHill

  • Mosquito
  • Posts: 15
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #5 on: April 04, 2024, 12:50:42 PM »

I now see.

Keep CEHill, please.

I will be glad to post similar topics to the General Forum. I was unaware that it encompassed code-based discussions.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #6 on: April 04, 2024, 12:59:01 PM »
That depends on what you want in return. You asked for a macro in a lisp forum (macro is not lisp).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #7 on: April 04, 2024, 01:00:33 PM »
"chilldaddy" has been deleted.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CEHill

  • Mosquito
  • Posts: 15
Re: Rookie Button Macro Issue: Linetype Loading
« Reply #8 on: April 04, 2024, 01:03:29 PM »
GREAT! I thank you for this change and also sharing your insights on this forum's guidelines.