NextGen Gallery Template V2 for captions under thumbnails

Unfortunately the NextGen gallery V2 templates documentation is a little confusing as some is for the old templates and some is about transitioning to the new. There is no basic page to explain what is going on. The best is here.

Thankfully there are really helpful people on the WordPress.org forum where they have explained various things.

Firstly I wanted to add captions below the thumbnails which was available in a standard template in the legacy setup but as they will be depreciating this shortly I thought I would set up the system properly with the new templates.

lheisey posted a very useful update on their issue which was the same as mine. Firstly you have to create the folder path as out of the box the install does not include this path, this can be done through CPANEL or FTP. The photocrati-nextgen_basic_thumbnails folder and its subfolder templates need to added. Full path is:

wp-content/ngg/modules/photocrati-nextgen_basic_thumbnails/templates/

Then you will need to create a file in the folder called something ending in -view.php. Mine I called test-view.php.

The contents of this file will be exactly the same as the one found at:

wp-content/plugins/nextgen-
gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/default-view.php

But with some additional code added at lines 55 and 56 (thank you to PostmasterGS in this post), this is slightly different to the code in the post as I could get the text to be visible with just a span, div or even with nested paragraphs inside. A heading with custom CSS solved that. I have used ak suffix so I can track the changes.

Adjusted code:

<div class="ngg-akcustom"><h6><?php if (!$image->hidden) { echo $image->alttext; } ?></h6></div>

In context (snippet from whole file):

 width="<?php echo esc_attr($thumb_size['width'])?>"
                    height="<?php echo esc_attr($thumb_size['height'])?>"
                    style="max-width:100%;"
                />
            </a>
        </div>
        <div class="ngg-akcustom"><h6><?php if (!$image->hidden) { echo $image->alttext; } ?></h6></div>
				<?php

				$this->end_element();

The accompanying CSS:

.ngg-akcustom h6 {
    color: #777;
	font-size: 12px;
	padding-right:5px;
	padding-left:5px;
}

Upgrading to PHP7

Not a CAD issue but a website one this time. I decided to bite the bullet and change my PHP version for the website from 5 to 7. This caused an “500 internal server error” which was not that helpful.

I turned on debugging (make sure you tutn it off afterwards) and that gave a slightly more “useful” error – “PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() ” – that was almost as cryptic but one search later and the soultion was easy.

For what is worth, I encountered the same error and the issue was solved by enabling the nd_mysqli extension in the PHP 7 configuration, and disabling the mysqli one.

Fracesco

Just change the PHP modules and your are sorted. One change later and all is good! Thank you Francesco!

Revit Frozen Palettes

A colleague of mine today had frozen palettes in their Revit LT. The properties and project browser were not clickable at all.

The solution is not as we discovered to reinstall but to reset Revit LT settings by renaming the registry folder group for revit as per the following video.

  • Close Revit LT
  • Lauch regedit
  • Go to current User –> Software –> Autodesk –> Revit 
  • Find whichever Revit you use , for example Autodesk Revit Revit LT 2018
  • Change the name Autodesk Revit Revit LT 2018_backup
  • Launch Revit LT again and the palettes should now work!

 

Random glitches, flat ucs and icon solid hatch

A colleague of mine could not hatch dots on a drawing at a higher density. I tried the usual regen and measurement commands to see if it was the hatch itself, however it was not to do with this.

After searching it could be a variable issue in the drawing but the drawing was from our standard template, but worth checking to see if HPMAXAREAS and HPMAXLINES were set to low values. They were not.

After further searching it became apparent that the drawing was a long way from the origin causing the glitches. This was apparent because the x leg of the UCS icon kept disappearing on zoom when in world UCS.

The glitches were:

  • Hatches not hatching properly at higher densities
  • ONSNAP not working properly
  • Fillet and trim not working properly

The solution was to create a drawing UCS closer to the drawing that fixed these glitches.

Creating a default layer sheet

As part of my preparing an AutoCAD drawing for my office’s layering system I managed to insert layers into a drawing from Excel using only scripting.

However the creation of a line and a text on each of the layers, so that users can copy and paste to get the layers etc. into new drawings, needed full AutoCAD and its access to LISP to create these quickly.

The script below is a modified (larger text and longer lines) version of a script, kindly written, from here.

(defun c:lintextfromlayer (/ pt dat ln)
(setq pt (getpoint “\nSelect insertion point: “))
(while (setq dat (tblnext “layer” (null dat)))
(entmake (list ‘(0 . “line”) (cons 10 pt) (cons 11 (mapcar ‘+ pt ‘(5000 0 0))) (cons 8 (setq ln (cdr (assoc 2 dat))))))
(entmake (list ‘(0 . “text”) (cons 10 (mapcar ‘+ pt ‘(5200 -125 0))) ‘(40 . 250) (cons 1 ln) (cons 8 ln)))
(setq pt (mapcar ‘- pt ‘(0 1000 0))))
(princ))

 

Xerox Printers AutoCAD Transparency Update

Recently we had Xerox printers installed and we could not get the transparancy to play nice with the printer, printing a small strip up the side of the page. We have now found a solution to the problem and after installing PS drivers and changing the settings on the driver page under the PC3 we use to the settings noted below all works fine. Thank you to placidrefining for their solution, which can be found on the following page. Whilst they note that this works with a 7970 printer, we have found that it works with our model as well.

 

I have posted the images below from that post here for reference.

xerox_transparency_working_pcl_settings

xerox_transparency_working_ps_settings-png

 

 

AutoCAD Broken File Associations

We upgraded AutoCAD LT 2015 to AutoCAD 2017 in the office by installing 2017, then carrying across settings and uninstalling the old one. On the first few PCs this worked OK but then it broke the Explorer file assciations horribly.

It produced an error along the lines of Cannot find AutoCAD LT 2015. Which was of course obvious because it was no longer on the machine.

After searching for the answer, this thread suggested wiping the machines, which currently was not an option.

The next option was to re-associate the files with AutoCAD rather than DWG launcher. This is really annoying solution as everytime you double click in explorer it launches a completely new process of AutoCAD which is very resource heavy when launched lots of times. This however was our temporary fix.

After some research, here is the solution if file associations in Explorer for AutoCAD are broken. This a tweaked version of what is shown on this page.

Fire up regedit (note you can break things with regedit, you have been warned!)

  1. Press WINDOWS-R on the keyboard to bring up the Run window, enter REGEDIT and click OK.
  2. Navigate to the following folder:
    HKEY_CURRENT_USER\Software\Autodesk\DwgCommon\shellex\apps
  3. Select the sub-key folder under “apps,” including the long string of numbers and letters that identify your version of AutoCAD.
  4. On the right pane, verify that the “OpenLaunch” key contains the path to the correct acad.exe file. Double-click and edit if necessary – this bit you need to change 2015 to 2017.

    aclt-fileassoc03

  5. On the left pane, right-click the folder with the long string of numbers and choose “Copy Key Name.”
  6. Select the “apps” folder, and in the right pane, double-click (Default).
  7. Delete the current data value and paste the key name that you copied. Be sure to remove the folder path that precedes the key name.
  8. Click OK and close the Registry Editor window.

I found at this stage nothing seemed to have changed. So ensure that you right click and go to choose another app.

aclt-fileassoc01

Once on the choose another app bit click on AutoCAD DWG Launcher and click Always use the app.

aclt-fileassoc02

This should mean that now when you double click DWG files AutoCAD LT 2017 will launch and all will work properly. You might find as we did that AutoCAD LT 2017 went through the initial start-up and migration settings again. Click always associate DWG files with AutoCAD LT if this box comes up.

You might find at this stage that your icons are still blank. No worries. Reboot.

Once rebooted we found when we double clicked that the “How do you want to open this file” box came up again. We clicked AutoCAD DWG Launcher and all the icons suddenly appeared.

Hope this fix works for you!

Plot transparency and Xerox printers

We had new printers in today, they were Xerox machines. They are quiet neat but not particularly useful when printing from AutoCAD. The reason why? Because for some reason AutoCAD and the Xerox drivers do not play nice with each other when printing with transparency.

When printing with transparency checked in the plot dialog the Xerox printers just print a small section of the page, about a 5th. Without that checked all is good.

The reason seems that AutoCAD prints vectors normally but when transparency is checked is prints rastors. For some reason this does not play well with the Xerox.

On this post on the second page are some settings but they are not on my driver version. I will investigate some options and update if I find a solution with the newer drivers.

Imperial dimension – metric drawing

One of my colleagues noted that she wanted all her measurements to be in imperial when dimensioning for her client. The drawing had been drawn in metric mm.

Whilst there are ways to convert the drawing in its entirety into imperial and visa versa, there is very little information on temporarily change the units or dimension style.

So here is how to place an imperial dimension on a metric drawing.

First go to the dimension style manager (_DIMSTYLE) and then select your dimension that you will be starting with. In our office we have a dimension style for each scale the drawing will be printed at (we have not got to annotative objects yet…). So I started with 1:100.

Metric Dimstyle, Primary Units tab
Metric Dimstyle, Primary Units tab

Click on new and it will create a new style based on the 1:100 dimension style selected. I renamed the new style to 1:100 feet so its clear that it is a different style but has the scale of 1:100 and is in feet!

Then leave every other setting alone and go to the Primary Units section. Change the unit format to Architectural and the Precision to 0′-0″.

Then change the scale factor to 0.0393700787. This scales the mm in inches. It is the basically the conversion of 1mm to 1inch.

Imperial Dimension (for metric drawing), Primary Units tab
Imperial Dimension (for metric drawing), Primary Units tab

Save style and that’s it. You now have a dimension style that outputs feet and inches from a metric drawing. Even better you can have both metric dimensions and imperial on the same drawing with this method.

Hollow Dimensions

My colleague asks me today, “why are my dimensions hollow and not filled?” I thought, maybe FILLMODE is not set. But that was OK.

It turns out that this can be caused by non-flat or “elevated” drawings. I.e. 2D drawings that extend into 3D space. Usually caused by UCS not being rotated properly and it being skewed into 3D space.

The solution is to change the UCS in the modelspace or paperspace viewport so it is flat and things should be back to normal!