Notifications
Clear all

Scripts

20 Posts
9 Users
0 Reactions
6 Views
(@spledeus)
Posts: 2772
Registered
Topic starter
 

I have some CAD skills, but I am always learning more. I started messing with Scripts. The documentation has not been as complete as I would like.

Last night I discovered that SCR files stop working at 500 lines. Is there a way to extend this?

I have found that some commands can be executed with a SPACE and others require an ENTER (next line). Is there a keyboard equivalent to ESCAPE = ^C^C for enter?

I have an engineer client who requires every CAD object to be COLOR = BYLAYER and LINETYPE = BYLAYER. For example, they need 8 fence layers for the 8 types of fence we call out. It makes the layers very robust and cumbersome. I am writing the script to isolate the one FENCE layer, then take all the objects with the LINETYPE = GUARD RAIL and put those on a FENCE GUARD RAIL layer, then LINETYPE = STOCKADE to FENCE STOAKCADE and so one... I have truncated the script, but I currently need at least 4 lines for each entry.

So who has skills in the ancient CAD wisdom of scripting?

 
Posted : November 27, 2015 7:00 am
(@gromaticus)
Posts: 340
Registered
 

I vaguely remember using ^m for a carriage return, but I don't remember knowing about SCR files.

Also try a semicolon ;

I would have used LISP for this, but the last time I wrote a LSP program was 20 years ago!

 
Posted : November 27, 2015 7:40 am
(@paul-in-pa)
Posts: 6044
Registered
 

How many layers does your template drawing contain?

How may layers get typically used?

I remove unused layers by inverting the "Show all used layers" command and deleting all the unused layers.

Alternately you can bring those layers in by having a template "Fence linetype legend" dwg, then copyclip the "Fence legend" into the current drawing and it will bring along those 8 layers and linetypes.

I am an engineer and a surveyor and pretty much do all lines linetype and color by layer. The few exceptions are for things like curve radius lines which I set by color gray, linetype center on the pnts-deeds layer. That way they are there for reference when I create a deed plot and disappear on the final dwg where I freeze all point layers. My in and out radius lines set are a single polyline and my boundary is a separate polyline on the adjacent-deed-line or boundary layers.

Quite often I need the radius lines to construct a curve for a deed that gives only arc length and radius. I assume radius perpendicular to sideline and then calc the delta, rotate the radius line and have my curve. For the few times it is non tangent, I rotate my radius polyline about the PC for a best fit.

I am with Gromaticus, the last time I used lisp was 20+/- years ago.

Paul in PA

 
Posted : November 27, 2015 7:42 am
(@mark-mayer)
Posts: 3363
Registered
 

I've done some scripts and I've done some LISP. This is a job for LISP. You might manage it with a script but it would be far easier with LISP. And LISP really isn't difficult to learn - at least so much that would be needed for this.

FWIW, I agree with your client and with Paul. It is best to have all entity colors and linetypes BYLAYER, and have more layers. Makes for better control (to you and your company, not the draftsman) over the look of your drawing. Also makes it easier to convert a drawing to another CAD Standard.

 
Posted : November 27, 2015 9:46 am
(@spledeus)
Posts: 2772
Registered
Topic starter
 

We are fast approaching 200 layers. They want them in National CAD standard format. I do not want to use NCS in my day to day.

 
Posted : November 27, 2015 10:33 am
(@gromaticus)
Posts: 340
Registered
 

Yeah, I don't like that either. I've received dwg files from other engineers with hundreds of layers, and I find them unusable. My standard template has 47 layers, and as the drawing progresses, that gets whittled down to 2 or 3 dozen, which I think is manageable.

I get annoyed with Carlson for the number of layers it uses for points, but I received some dwgs where there were separate layers for shots in different areas. I swear some people use different layers for each shot!

And then there are architects...

 
Posted : November 27, 2015 10:48 am
(@dougie)
Posts: 7889
Registered
 

There used to be a layer translater in LDD, I used it to translate wildsoft layers 20 years ago; haven't needed to since. I would think that it would still be available.

 
Posted : November 27, 2015 10:50 am
(@spledeus)
Posts: 2772
Registered
Topic starter
 

I have the translator setup, but it is a 1:1 correspondence. This does not decrease my layers.
I will eventually learn LISP, but that is not in the cards right now.
I am working on a Script to reduce my 200 layers to 50, then I will create one to increase my 50 back to 200 in either my format or NCS format. These are just the existing layers. I still have aerial, boundary, survey, existing and to be removed.

 
Posted : November 27, 2015 11:17 am
(@a-harris)
Posts: 8761
 

I have a friend that puts each different named description in its own layer and most of them plot objects king sized. His drawings drive me mad.
When I started using Carlson, I had the same problem. Too many layers. It took me a while to notice that Carlson give the opportunity to choose what layer everything winds up in and I have narrowed most everything down to 7 basic layers.
I will miss that option occasionally and do a global change of layer to put everything in Final for a completed drawing.
When I send him a drawing I will send him the ascii points file and let him develop his own new drawing as his setup creates all his working layers as he imports the points into the drawing.
Now if I could get him to understand the importance of changing the scale factor of his use of objects and linetypes so his drawing would look more to scale. Like between two monuments or power poles, the fence or electric line should have more than two x or E in a 500ft span.
People told me to just accept what values Carlson places on the drawing......don't work for me.
It can be customized and it is not that difficult to make it the way you want it.
:gammon:

 
Posted : November 27, 2015 1:34 pm
(@spledeus)
Posts: 2772
Registered
Topic starter
 

Are you talking about this? I had someone run a few drawings this this selected and it made 1.21 gigalayers.
I run all my field points through 4 layers:
S-ESE-PTS-TOPO
S-ESE-PTS-LOC
S-ESE-PTS-TRAV
S-ESE-PTS-CK
And my record points on S-ESE-PTS-REC.

 
Posted : November 27, 2015 2:04 pm
(@mark-mayer)
Posts: 3363
Registered
 

The layer list can get long, and that is a pain. I still say it's better to use BYLAYER and have as many layers as necessary. A long layer list is less onerous if the names follow a logical form as those of the US National Standard do. Layer Property filters are handy for dealing with long lists.

 
Posted : November 27, 2015 4:23 pm
(@gromaticus)
Posts: 340
Registered
 

spledeus, post: 346256, member: 3579 wrote: Are you talking about this? I had someone run a few drawings this this selected and it made 1.21 gigalayers.
I run all my field points through 4 layers:
S-ESE-PTS-TOPO
S-ESE-PTS-LOC
S-ESE-PTS-TRAV
S-ESE-PTS-CK
And my record points on S-ESE-PTS-REC.

No, I don't have that one checked. Now I'm scared to; 1.21 gigalayers would probably overload my flux capacitor!

It's been a while since I played with the settings, but the best I was able to do was to get a point on 5 layers. So if I put them on layer PNT, I also get PNTDESC, PNTELEV, PNTMARK, and PNTNO. I have no need for this, but I couldn't find a way to get Carlson to just use layer PNT for all the elements. And when you add TOPO, LOC, SURVEY, etc. you end up with a lot of unnecessary layers. After reading your reply, I wonder if I missed something. Are you able to put a point on layer S-ESE-PTS-TOPO without creating the sublayers?

 
Posted : November 28, 2015 8:09 am
(@bruce-small)
Posts: 1508
Registered
 

spledeus, post: 346213, member: 3579 wrote: I have some CAD skills, but I am always learning more. I started messing with Scripts. The documentation has not been as complete as I would like.

Last night I discovered that SCR files stop working at 500 lines. Is there a way to extend this?

I have found that some commands can be executed with a SPACE and others require an ENTER (next line). Is there a keyboard equivalent to ESCAPE = ^C^C for enter?

I have an engineer client who requires every CAD object to be COLOR = BYLAYER and LINETYPE = BYLAYER. For example, they need 8 fence layers for the 8 types of fence we call out. It makes the layers very robust and cumbersome. I am writing the script to isolate the one FENCE layer, then take all the objects with the LINETYPE = GUARD RAIL and put those on a FENCE GUARD RAIL layer, then LINETYPE = STOCKADE to FENCE STOAKCADE and so one... I have truncated the script, but I currently need at least 4 lines for each entry.

So who has skills in the ancient CAD wisdom of scripting?

I have never noticed a limit on the number of lines in a script file. Mine often run to 15,000 lines.

 
Posted : November 28, 2015 10:46 am
(@peter-lothian)
Posts: 1068
Registered
 

Why don't you use a different Field-to-Finish file for this engineers projects, coded to place your survey data in the separate layers that he is asking for? Seems that it would be easier to set up the F2F file than to go mucking about with scripts to translate things over.

 
Posted : November 30, 2015 6:08 pm
(@spledeus)
Posts: 2772
Registered
Topic starter
 

Some follow up.

Peter, F2F is great and I could isolate the project to their standard, but we reuse the data all the time. It is easier to have it in our format then convert an export package out. Plus, we use Carlson and they use Civil3d, so we already have to maneuver around their needs. While I have a seat of Civil3d, I do not have the skills to run the project through. I only have the skills to convert a Carlson Project and check it out.

Bruce, I am testing this on IntelliCAD if that makes a difference. Not sure why I cannot run a script of more than 500 lines, but I found a way around it: A script that calls on other scripts.

I have completed the my large 1:1 layer set to my compact layer set (plus I cleaned my linetype names to be more logical). I am now reversing it and converting from the compact set to their NCS standard.

 
Posted : December 12, 2015 10:43 pm
(@jim-frame)
Posts: 7277
 

spledeus, post: 348900, member: 3579 wrote: Bruce, I am testing this on IntelliCAD if that makes a difference.

I found the AutoLISP implementation in IntelliCAD sadly lacking, so it wouldn't surprise me to learn that its scripting capability is less than robust.

 
Posted : December 12, 2015 10:51 pm
(@jim-frame)
Posts: 7277
 

Paul in PA, post: 346217, member: 236 wrote: I am with Gromaticus, the last time I used lisp was 20+/- years ago.

I use AutoLISP daily, and rarely use scripts.

 
Posted : December 12, 2015 10:53 pm
(@gromaticus)
Posts: 340
Registered
 

Aacck! I've been slandered!! :-O

What I meant was that it's probably been 20 years since I last wrote a lisp program from scratch, but I still use those routines every day - I couldn't live without them.

It's one thing to buy software and learn how to use it, but having software that will do exactly what YOU want it to do, and you can change when your preferences change, is (to me, anyway) much more useful. This is one of the reasons that I have stuck with Autocad since the 1980s instead of switching to a "lite" version or Intellecad, etc.

 
Posted : December 13, 2015 4:39 am
(@spledeus)
Posts: 2772
Registered
Topic starter
 

I have Autocad at work and intellicad on my laptop. It is decent but not complete. It will not open my most nasty drawing, but that is tough for CAD as well. I play with these scripts in front of the tv.
Thanks for the guidance.

 
Posted : December 13, 2015 5:23 am
(@jim-frame)
Posts: 7277
 

Gromaticus, post: 348906, member: 597 wrote: It's one thing to buy software and learn how to use it, but having software that will do exactly what YOU want it to do, and you can change when your preferences change, is (to me, anyway) much more useful. This is one of the reasons that I have stuck with Autocad since the 1980s instead of switching to a "lite" version or Intellecad, etc.

You might be surprised at how friendly you'd find BricsCAD. After the IntelliCAD disappointment I decided to give the Bricsys offering a try, and found its AutoLISP implementation to be even better than AutoCAD's -- faster and with additional functionality. And the difference in cost is dramatic!

 
Posted : December 13, 2015 8:16 am