Showing posts with label lsp. Show all posts
Showing posts with label lsp. Show all posts

Friday, 16 March 2012

Missing .shx and .shp files in xref slows Civil3d performance, causes slow starts an more

At the start of the year I had a job that just caused Civil3d to preform like a dog, I started a blog post then that I never finished until today, when I encountered the same drop in performance.

At the beginning of the year when opening a file it appeared to stall on “finding interior borders”. Today i was having slow regen’s and slow jumping between model space and layouts and constant Civil3d (not responding) prompts.

It turned out that both these issues in performance were the result of missing .shx and or .shp files in the base survey xref from a sub consultant.

To find the issue the first time i spent most of a morning troubleshooting the situation trying the following:-

  1. Auditing for errors
  2. Purging all the unused stuff
  3. Detached all xrefs
  4. Promoted the Drefs
  5. Closing the drawing on model so as to not regen when in a Layout on opening
  6. Saving the file to c drive rather than a network drive.

It seemed the only noticeable improvement occurred with the xref’s detached.

On opening the Xref itself i noticed in the command line that 3 or 4 .shp files were not being found. Using the lsp findshp I found the lines using the shp files and swapped them out.

Today the issue was the same but missing .shx files. To fix it this time I requested the missing files from the subconsultant and installed them as discussed here http://advsurveying.com/advcad/?p=180

Hope this saves some of you from the dreaded (not responding) prompt one day.

Sunday, 12 February 2012

Quickly Saving and changing Views

For years I have used some lsp code in my acad.lsp file to save and restore views to jump from place to place in a drawing typing V1 saves view 1 typing R1 restores view 1 and you can save upto 10 views 0 to 9. I just updated the code last week to also save a layer snapshot at the same type here is a capture of the original code.

k5msbeax

here is the revised code and link to the code in a txt file
maldsrto

Sunday, 17 April 2011

Quickly Deleting Recovered drawings

Just loving this button at the moment to jump quickly to the drawing folder and delete recovered drawings messing up the folder.
http://c3dxtreme.blogspot.com/2011/02/open-windows-explorer-in-folder-of.html

Monday, 21 February 2011

Road Assembly Labelling Code Updated

Jeff Mishler has kindly updated my original code for Labelling Road Assemblies to 2011 and beyond and created a lsp version both are downloadable here
http://forums.autodesk.com/t5/AutoCAD-Civil-3D/Label-assembly-with-field-automatically/m-p/2924234#M146484
my original post can be found here
http://c3dxtreme.blogspot.com/2010/12/automatically-label-those-road.html
someone else has done a similar .net version here
http://www.texupport.net/blog/2010/12/20/labeling-assemblies/

Friday, 11 February 2011

Open Windows Explorer in folder of currently open drawing

Alot of the time you are working a way on a drawing and someone wants something emailed from the current job folder you are in to them. To jump to that job file in explorer. Add the following code from this 
link
to a toolbar button so when you press it Windows Explorer is opened at the current drawing folder.

^C^C^P(STARTAPP (strcat "EXPLORER /e," (getvar "dwgprefix")))

1. Type CUI
2. Make a new custom command
3. Paste the code above into the command
4. Drag the command up to a toolbar you want it displayed on.




Monday, 13 December 2010

A little LSP selection Gem for Civil3d that keeps on giving

I wrote this little bit of lsp code way back in 2008 for the quick and easy selection of civil3d objects, before the “Select Similar” and “Select Object” functionality was introduced to Civil3d under right click on the shortcut menu in drawing space and prospector. 
However these commands have not made this code redundant, it just seems it keeps on giving time and sums up my core philosophy to using Autocad and Civil3d. If I can, I will find a quicker way.
Basically the code was born back in the day thru the frustration of having to use the “qselect” to find those pesky little diamond grading object markers in a drawing and the amount of time and clicks that it took to rebuild the same selectionset over and over again to find the little things and check if you were in the drawing or the grading in the drawing was corrupt.
Here are examples of the commands I use most frequently and how I use them in my workflow to save time.
  1. SelectGrading = SG , Type SG finds all the grading objects in a drawing. Right Click select Object View and there’s my model
  2. SelectFeaturelines = SF, Type SF and find and select all featurelines
  3. SelectAlignments =SA, Type SA select all alignments, Bring Alignments to the front, Make all Alignment Styles the same by pressing Ctrl+1 and changing the style in the property windows.
One advantage of this routine has over Select Similar is all similar Civil3d Objects in a drawing are selected even if the object styles are different. Unable to display content. Adobe Flash is required.
The code consists of 10 simple lines of code as follows:-
;************************************************************************************* ;this routine selects all the alignment objects is a drawing ;saves having to use the qselect command and clicking three or four times
(defun C:SELALIGNMENT () (ssget "_X" '((0 . "AECC_ALIGNMENT"))) (setq sset (ssget "P"))   (if sset     (progn       (sssetfirst sset sset)       ;(command "_.PROPERTIES")     )   ) ) (defun c:SA () (C:SELALIGNMENT))
;************************************************************************************** You can create more Civil3d and Autocad object selection commands by copying the block of code above and say if you were wanting to select Parcels select a parcel in a drawing and list it image  In the first line of the list you get the object type “AECC_PAREL” swap this for “AECC_ALIGNMENT” in the code block also change the SELALIGNMENT to say SELPARCEL and SA to SP. You can download the lsp file AH-Selectgrading.lsp I use here if you wish there are a few other routines included that you can delete out of the file if unwanted. https://sites.google.com/site/c3dxtreme/
If you guys like this sort of stuff leave I comment. If not tell me what you wish to know more about or what Civil3d should do you never know I may have been there and done it before.

Thursday, 9 December 2010

Learn Acronyms and become a keyboard Wizard

There is nothing I hate more than the time wasted moving the mouse to click a button. So I am a great believe in the power of the keyboard. To harness this power I use a lot of 1 to 3 letter acronym’s to trigger commands. I remember these by quoting the command to myself each time trigger it and having the acronym made up of the first letter in each word that makes up the command name so for example the command QuickEditFeatureElevs would be QFE. There are a number
of possible combinations using the 26 letters in the alphabet there are in fact:-
clip_image002 where clip_image004n = number of letters in the alphabet
k =length of the acronym
Number 1 Letter combinations
clip_image006
Number 2 Letter combinations
clip_image008
Number 3 Letter combinations
clip_image010
Therefore there’s 2951 lets say 3000 between friends 1 to 3 letter acronym’s that’s quite a few commands you can trigger from the keyboard. To add acronym’s commands you need to create a list of alias commands for the longer commands to do this :-
Open the acad.pgp file by selecting the following from the menus Tools->Customize->Edit Program Parameters(acad.pgp) or typing (startapp "notepad" (findfile "acad.pgp")) at the command line.
Scroll to the end of the file and add the user defined commands alias you want here is an example of the what is in my pgp file
image
Save and close the acad.pgp file and type reinit at the commandline and reload the .pgp file. Your alias acronym’s will be available.

Wednesday, 24 November 2010

VBA in STARTUP function in acad.lsp

Remember that the aireys menu item is added by vba thru the launch of a lsp function with Startup function in the acad.lsp file.
As vba is not in 2011 I have commented out this function not to run. The following menu will not be displayed any more until the code is updated to vb.net
image
Related Posts Plugin for WordPress, Blogger...