Monday, January 27, 2014

AutoLISP progn error: too many arguments SOLVED

I was working on an existing AutoLISP program for AutoCAD while I found that during “Check Text in Editor” (or “Check Selection”) I got an error. It worked fine to just load and run the program but check did not. Trying to make an application (FAS or VLX) will also give this error.

; error: too many arguments: (PROGN 1 2 3 ... )

It was really confusing until I realized that progn only accepts 255 arguments. Often progn is used to together with if to allow more expressions to be evaluated and in a case like that it can easily happen that there are more than 255 arguments.

This is en example of how to reproduce this:

(progn
  1    2    3     4    5       6    7    8      9    10   11     12   13   14
  15   16   17     18   19   20    21   22      23   24   25     26   27   28
  29   30   31     32   33   34    35   36      37   38   39     40   41   42
  43   44   45     46   47   48    49   50      51   52   53     54   55   56
  57   58   59     60   61   62    63   64      65   66   67     68   69   70
  71   72   73     74   75   76    77   78      79   80   81     82   83   84
  85   86   87     88   89   90    91   92      93   94   95     96   97   98
  99   100  101     102  103  104    105  106  107  108  109     110  111  112
  113  114  115     116  117  118    119  120  121  122  123     124  125  126
  127  128  129     130  131  132    133  134  135  136  137     138  139  140
  141  142  143     144  145  146    147  148  149  150  151     152  153  154
  155  156  157     158  159  160    161  162  163  164  165     166  167  168
  169  170  171     172  173  174    175  176  177  178  179     180  181  182
  183  184  185     186  187  188    189  190  191  192  193     194  195  196
  197  198  199     200  201  202    203  204  205  206  207     208  209  210
  211  212  213     214  215  216    217  218  219  220  221     222  223  224
  225  226  227     228  229  230    231  232  233  234  235     236  237  238
  239  240  241     242  243  244    245  246  247  248  249     250  251  252
  253  254  255     256
)

The workaround I used was to add a few extra nested progn and problem solved.

Another way is to use cond like this:
(cond (T
1 2 3 all the way to 256 or higher will work fine
))

And of course create a new function with defun.

But what about using (repeat 1 …) as a workaround saving an extra pair of parentheses compared to cond? Unfortunately repeat has the same limitation of 255 expressions as progn.
; error: too many arguments: (REPEAT 1 1 2 ... )

What then is progn other than a way to bundle together a lot of expressions?
  
Progn evaluates each expression sequentially and returns the value of the last expression. In the progn example above the returned value would be 256.

Monday, January 20, 2014

Updates for Inventor and other Autodesk News and Tips

Here’s some recent links that can be useful.

Update 2 for Inventor 2014 Service Pack 1 - DL22744369

Update 4 for Inventor 2013 Service Pack 2 - DL22744178

Autodesk Privacy Statement was updated March 19, 2013

Crash when launch Autodesk software on Windows 8.1 with dual video cards where one is Intel HD Graphics 4000 - DL22827547

MrSID (4th gen) crashes AutoCAD - TS22852592
When you try to insert or connect to a MrSID (*.sid) file in AutoCAD Map 3D, Civil 3D, or Raster Design, the software crashes with a Fatal Error.
4th generation MrSID images are not yet supported by AutoCAD-based products.

“An error occurred attempting to create the transmittal. Please make sure the target location is writable and that the target disk has sufficient space.” - TS22852599

Error: "There was a problem adding data to Map" when connecting to WMS in Civil 3D or Map 3D - TS22852604

When using Parallels on Mac, the activation screen displays large overlapping text - GS22859328

How to Create the SCCM Software Installation Package - TS22029889

How to remove files left after a failed AutoCAD installation - TS21942335

How to repair an AutoCAD installation - TS22857015

Creating a layout profile, grips become offset from the crosshairs - TS22859189

Raster Design does not start if Windows roaming profiles are used - TS22859271

Modeling Operation Error: Missing double in restore file - TS22859321

Geomap function does not show a map - TS22859310

WMS not visible in AutoCAD Map - TS22859275

Slow performance when switching between layouts - TS22859315

Geotechnical Module: After importing borehole data all results seem to be scaled - TS22859305

Error: This drawing was created with a newer version of Civil 3D - TS22859326

Error: 1: 5 2: adlmPITSetProductInformation failed. 3: 2 + Security Permissions - Up and Ready

Monday, January 13, 2014

SmartPurger 3.5 released

SmartPurger 3.5 from JTB World is now available both from our product page as well as on Autodesk Exchange Apps. A free trial is available of SmartPurger so you can give it a try.

SmartPurger not only purges multiple drawings but can also batch process most anything you like if you have any Script or AutoLISP files you want to run on a bunch of DWGs. If you don’t know how we can help to create it so you can automate your manual tasks. An AutoCAD based application is required to run SmartPurger but it can also work with other DWG compatible CAD applications.

These are the bug fixes for this release:

-Fixed a bug where accoreconsole did not save to specified DWG version
-Purge multileader styles bug fixed where it did not always purge these styles.
-Handle dialog box about VBA not installed
-Fixed bug where Educational Version - Terminated sometimes show up in status column even though the drawing is not educational

If you are interested in other useful AutoCAD helper functions take a look at JTB Sheet Set Creator, DigSigStamp,Batch Publish for AutoCAD, DimensionPatrol, TransTips or OffsetInXref.

If you need any custom app created, small or large, for AutoCAD or Revit you are welcome to contact us.

Tuesday, January 7, 2014

AutoCAD P&ID 2014 Service Pack 1, Autodesk Beta, News and Hotfixes

Anyone with an Autodesk account can access the entire library of video recordings and class handouts from more than 600 classes from AU 2013 in Las Vegas—for free at the AU website, login and click on Classes on Demand.

Autodesk Completes Acquisition of Circuits.io (Autodesk 123D Circuits) - press release

Autodesk Beta Season is in Full Swing - Do you want to test & help improve the next versions of Autodesk products? https://beta.autodesk.com/. If history is followed future products can be AutoCAD 2015, Revit 2015 and so on.

Inventor 2014 SP1 crash on Start-up Windows 8.1 with Intel HD Graphics 4000 - Up and Ready

Working with Inventor and antivirus software - TS22811064
When you work with Inventor and there is antivirus software active on your machine, you may experience slow performance. For example, you may have slow response times while using Inventor and the refresh of Inventor UI may be slow. This is caused by antivirus software and you would like to optimize your performance.

Hotfix: Fix Fillet Translation, Punch Note Untranslation in Inventor 2013/2014 - DL22823934

Hotfix: Correct issue with “Cut” feature which cannot be selected in a “Pattern” operation in Inventor 2014 - DL22823063

Hotfix: Fix incorrect hotkey issue for command “Delete” in context menu in Inventor 2013 - DL22823494

Hotfix: Correct untranslation of column headers in sheet metal column headers in Inventor 2012/2013 - DL22823919

Sites disappear, but feature lines remain until audit in AutoCAD Civil 3D 2014 - TS22811035
Sites are disappearing from the drawing, but the Feature Lines remain. When you run AUDIT or RECOVER, the Feature Lines then disappear.

Direction in Object Viewer does not match UCS in AutoCAD Civil 3D - TS22813499

Xrefed survey figures plot with the wrong plot style in Civil 3D 2013 - TS22814640

Error: "Please wait while Windows configures AutoCAD Raster Design" - TS22817946

Wipeout draw order is not working with viewports - TS22817919

Error: "Not enough free RAM for HIDE--some lines will be hidden incorrectly" - TS22824497

AutoCAD P&ID 2014 Service Pack 1 - DL22757675
This Service Pack does not apply to AutoCAD Plant 3D 2014 Extensions 1 or 2 (Subscription). The updates in this Service Pack are included in Extension 2. AutoCAD 2014 Service Pack 1 is included in this service pack.

Issues fixed with this Service Pack:

P&ID Drawings

  • A new slregroup command has been added to make it easier to manage line groups. For more information, see About P&ID Line (SLINE) Grouping.
  • The Edit Sline Group... command was not available in the shortcut menu.
  • Control valve substitution did not work. If the substitution palette does not display correctly, you can erase and replace the control valve.

Customer Reported (CER) Defects

3D Model

  • File open command would fail when a drawing is opened that contains custom entities with embedded 3D solids.
  • Return bends would not always align with routed pipe.
  • Parts created with plantpartconvert could not be selected in the Spec Editor.
  • Ladders and structure did not always display correctly in an Ortho view.
  • Butterfly valves placed into a short pipe segment could cause the program to shut down unexpectedly.

Isometric Drawings

  • Splitting at a branch would sometimes place components outside the draw-area.
  • Tap weld was assigned to the same line number as the olet.
  • Improvements to isometric drawings including annotation and dimension placement.

Spec Editor

  • Flange thickness in inches did not update correctly for metric projects.

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner