Jump to content

Recommended Posts

Posted

Hopefully can find some advice on creating a linetype from the ANSI 31 hatch type (/////////) I've read the many posts about creating linetypes but just can't figure this out..So far Autocad just gives me an error when I try and use 1/2 of the code from ZIG ZAG linetype below. Below that is what I have thus far. Any help would be greatly appreciated..we use this all day long at work and was hoping to turn this into an mline so I could just pic a point a long a wall (only 4" walls needed) and drag along as needed. Thanks again!

 

*ZIGZAG,Zig zag /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
A,.0001,-.2,[ZIG,ltypeshp.shx,x=-.2,s=.2],-.4,[ZIG,ltypeshp.shx,r=180,x=.2,s=.2],-.2

 

ANSI31, ANSI31 ////////////////////////////
A,.0001,-.2,[ANS,ltypeshp.shx,x=-.2,s=.2],-.4

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    17

  • jake77777

    14

  • rkmcswain

    1

  • ReMark

    1

Top Posters In This Topic

Posted Images

Posted

Did you create a shape named ANS in the "ltypeshp.shx" shape file?

If not, that is one reason you are receiving an error because the linetype definition is looking for ANS...

Posted

Thanks, I was definitely missing that..off too figure that out :)

Posted

The closest I came was a backslash followed by dot..then repeat. The .shx files I'm finding close to ANSI 31 are in some hieroglyphic code..Perhaps the complex part of it! That was made using MKLTYPE command. Looking through the posts all I've come across was references to help topics but I never saw a "specific" linetype shx & .lin code..I thought this would be one of the first ones to be requested. So..if anyone can help with a code I'll certainly pay..$25??..and would be extremely grateful!! Please email me at michael82982@hotmail.com. if you can help out. This has taken me 10 hours in the last 2 days with a lot of other lisps to focus on..and I'm still at square one!..if i wasn't specific enough in the starting thread..Its a linetype with a line running at a 45 deg. angle, 4" total height, w/ 18 spacing (3.182" apart).

Posted (edited)

jake77777,

 

Try this code. Maybe it will give you some ideas.

HLIN.lsp

Edited by The Buzzard
Posted

Better yet,

 

Use this code, It has a while loop instead of the function type loop used in the previous code posted.

Syntax HLIN2

Note that you may see funny results using hatch as a linetype.

HLIN2.lsp

Posted (edited)

jake77777,

 

Please do all correspondence here on the forum. I am not charging you for this. If you need some changes done to the program, Please post it on the forum. I will help any way I can and I am sure others will as well.

 

Let us know,

The Buzzard

Edited by The Buzzard
Posted

jake77777,

 

I made the fixes you wanted and it seems to work well. I have questions for you with regard to the layer and program name.

What is the layer Name?

What is the layer Color?

What is the Linetype?

And if used, What is the layer Lineweight?

What name do you want to use for the program?

 

Once this is taken care of you should be all set and I will post the program for you to test.

Let me know.

Posted

I think for layer name STR-TXT works. The color 11, solid linetype, No layer lineweight being used. If bylayer is an option for the color that could work a little better, though honestly either way if not an option. And ANSI for name. If no charge..If you need struc. details ever..I'm plentiful! thanks again

Posted
I think for layer name STR-TXT works. The color 11, solid linetype, No layer lineweight being used. If bylayer is an option for the color that could work a little better, though honestly either way if not an option. And ANSI for name. If no charge..If you need struc. details ever..I'm plentiful! thanks again

 

Here you go,

 

I have a sample drawing attached with basic comments. Also note once you start program with ANSI it will run continuously as long as you left click the mouse. When you right click the mouse you have the option to start over or exit the program. The program defaults to your settings, But I left you with the option to change them from the prompt if you want.

 

Good Luck and let me know how it goes.

ANSI.lsp

ANSI.dwg

Posted

I definitely see the changes you did. Though I think this could be a lost cause..Sometimes the hatch will extrude over a 4" wall for some reason..It also did what a few of my lists/commands do and I'll probably just make a new post if you don't feel like responding..but taking this one for example..Before making a macro in the toolbar I would have to specify info for the 3 prompts. After making the macro with the lisp and the specifications included..I just have to press it once, BUT THEN to repeat the command (even with repeat command yes on lisp code) It will prompt me for the 3 specs. Any way to repeat the macro as a whole? Let me know if its best to throw this in with the masses..thanks for all your help.

Posted (edited)

Sorry about that,

 

I had to fix the object snaps.

All you need to do for the macro is just call the command ANSI. The program does the rest.

I assume you want the specs hard coded in instead of the prompts. No problem. I will repost.

Edited by The Buzzard
Posted (edited)

Try this copy, The specs are hard coded in. No prompts at all.

 

The macro should just call ANSI. Do not try to set the specs thru the macro. Let the program handle it.

 

Example: ^C^CANSI

ANSI.lsp

Edited by The Buzzard
Posted

Par Great! That's SO much better/more efficient than the way I use to hatch. I won't take too much of the credit when I take it to the office! haha I kid, thanks!

Posted (edited)

Do what you need to do. And try to remember that I am not where you are, So glitches will happen when writing code and needs to be tested and reported. At some point it all gets fixed. So do not worry over those error from before. We take them as they come and fix it. Where the inputs were concerned was no error. I thought you would want the advantage of changing the settings while in the program. I was not sure that you wanted this to be hard coded. No big issue anyway.

 

Enjoy the code and do not hesitate to let me know if there is a problem.

Edited by The Buzzard
Posted (edited)

jake77777,

 

My apology, But I put the Save User Settings in the program twice. The previous version should not be affected by this, But I have attached a clean copy with the fix. Also since we hard coded your settings in I thought it would be best to remove the global variables and replace them with local variables. Also I found that the snaps within the while loop needed to be turned back on after the hatch is created. This is now all fixed and tested completely. It does not pay to get in to a rush.

 

Sorry about that.

The Buzzard

ANSI.lsp

Edited by The Buzzard
Posted

Perfecting something I thought was perfect.. I can't tell you how much better this is than drawing a line to close of the wall than going back to delete. Making a designers life better one lisp at a time! Thank you Buzzard!

Posted

"Making a designers life better one lisp at a time!"

 

I think that's the Buzzard's new mission statement.

Posted

As I said before, It just does not pay to rush. Sorry about that. I might also figure a way to have it draw the hatch going the other way. So just maybe were not really done yet?

Posted

Can't you just mirror the cosmile.gifdesmilie.png I wouldn't complain if you made it! We use a macro w/ the lisp..it would be VERY convenient labeling one top and one bottom and always knowing you can always start hatch from left to right and hatch the entire wall (or vice versa). And probably even more convenient for newer CAD users. (Beautiful illustration below shows the hatching (should be renamed quick hatch!) that can be selected starting from left to right using snaps..leaves 4" ends off unless you start from the right. I think it's one of those things that with a little practice..soon can be perfection..

 

I I I I

I I I I

I IIIIIIIIIIIIIIIII I

I ////////////// I

IIIIIIIIIIIIIIIIIIIIIII

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...