AutoCAD Inventor :: Prevent User To Start Other Command While Executing A Macro
Feb 21, 2013
I have a macro that automatically creates a Detailed view on a sheet. It works on 2 input's:
- mouse click 1 (set's the target to be detailed)
- mouse click 2 (set's the location where the balloon should be)
The code works fine. But sometimes the user will start another command, or restart the same command, while it is still running. This off course gives all kinds of problems.
Is there a possibility in VBA to prevent the user to start another command while this command is running?Or is this problem a part of the clicking itself?
Here is my (it uses a Class Module called: clsGetPoint, see code below)
Sub AutoDetailedView() On Error GoTo ErrorManagment '(error handling 2013/02/18) 'step 0 Create a transaction. -> for 1 undo command Dim oTransMgr As TransactionManager Set oTransMgr = ThisApplication.TransactionManager Dim oTrans As Transaction Set oTrans = oTransMgr.StartTransaction(ThisApplication.ActiveDocument, "AutoDetailedView") 'step 1 Select a drawingView 'Set a reference to the drawing document. Dim oDrawDoc As DrawingDocument Set oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the active sheet.
[code].....
View 5 Replies
ADVERTISEMENT
May 14, 2012
I have a macro which
1) checks to see if the active document is a drawing
2) Checks that the drawing is of a part
I want to prompt the user to select a view on the drawing, if this is not the first view on then a warning message is displayed.
Then I want to take this active view and change all of the geometry lines and holes EXCEPT for bend lines to a specific layer.
View 4 Replies
View Related
Sep 30, 2012
I am occasionally developing with ObjectARX 2013. The problem: A command being executed from a document needs to focus on another document. I am doing that as:
Application.DocumentManager.MdiActiveDocument = aGeneratedDrawing;
After this line, the focus is taken by the other document. But the command execution just stops without producing any visible error or catchable exception. Apparently, the document focus cannot be changed during execution of a command.
A solution: What worked in the end was displaying a .NET form inside the command, like:
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(aForm);
Then, performing the very same set of actions on a button click works flawlessly.
The question is: can using the form as a mediator be avoided? It is redundant there. I tried hooking to CommandEnded, executing the code as a separate command via Application.DocumentManager.MdiActiveDocument.SendStringToExecute, and also executing the code in a separate delayed thread. So far, only triggering the code via the form worked.
View 4 Replies
View Related
Dec 6, 2013
when i work on geometry which is not in orthographic orientation i always prefer to create orthographic view of this, that's what i do :
Command : ucs
Command : z
Command : (selecting representative angled 2 points)
Command : plan
Command : c
than the whole zoom is lost , and i need to find again the portion , and save a view. i want to automate this process but before i automate it i want to know if there is a way to avoid zoom lost after executing the (plan) command?
View 7 Replies
View Related
Dec 17, 2012
Im having a little trouble of late understanding how to undertake an action/ command if nil
what i do know id the following:
(setq TESTvar(findfile "acad.lsp"))(alert TESTvar)
this gives me the path of the acad.lsp, that is provided it actually exists, however because the acad.lsp is not compulsory it may indeed not exist meaning that the command prompt would return the NIL value instead of the pathname.
based upon that I would like to create a new acad.lsp file if not found by autocad.
View 3 Replies
View Related
Oct 26, 2012
I have keyboard commands set up for exporting my .idw drawings to .pdf format (PD for me.) I would also like to set this up for exporting my drawing to .dxf format. I think this can be done with a macro that can be activated by a keyboard command, but I could be wrong. I don't want to do this with an iLogic.
View 6 Replies
View Related
Feb 11, 2004
Is there any macro-command to do this :
"Open the .idw that you created your title block in. Locate and right click on your title block in "drawing resources". Select copy. Open the file that you want to put your title block in. Right click on "drawing resources" and paste your title block there. Now you will have to delete their title block and then activate yours. "
I want to change my drawing template and I have many to do and it must have somewhere somehow a way to do this automatically?
View 8 Replies
View Related
May 7, 2013
I have one user (user 1) who will work on a drawing and while they have it open, another user (user 2) opens the same file and they are prompted it is in use and they can open a read-only copy. Once user 2 opens the read-only copy, user 1 can no longer save their drawing until user 1 closes the read-only copy.
User 1 gets the following error when trying to save:
"Unable to save to drawing X:folderpathfilename.dwg as it is being accessed by another session. Drawing saved to X:folderpathfilename.tmp"
This does not happen everytime either.
View 3 Replies
View Related
Apr 12, 2012
How to prevent Lightroom auto-start when inserting flash stick or CD?
View 1 Replies
View Related
Oct 2, 2013
Before I upgraded to AutoCAD 2014 (was using 2012) when I used the MOVE command on 3D geometry (while using the Realistic Visualization) I could see one object move into another. Like, moving a cylinder into a box to represent a button, and I would see it slowly sink into the box as I moved it further and further along.
In 2014, the object I am moving will REMAIN ON TOP visually of all other geometry until it is completely inside the other geometry (at which point it disappears completely). It's hard for me to then judge just how much of it is sticking out during the MOVE command. Once I complete the move command, the proper visualization order is then shown.
In other words, if I have a 10 inch cylinder, and I'm trying to move it into a box so only 2 inches sticks out (as a visual guesstimation), currently I would see ALL 10 inches of the cylinder whether part of it is inside the box or not, until I complete the MOVE command.
View 9 Replies
View Related
Jul 6, 2012
I am working on a lisp to scale drawings of various sizes to a predetermined size. After the lisp has run and scaled the drawing, the prompts for base point and reference point run a second time. How can I get this to run through once? I think it has something to do with the way the reference length is being entered. The base point and first reference point are the lower left corner of the drawing, while the second reference point is the lower right corner.
(COMMAND "SCALE" "ALL" "" (SETQ A (GETPOINT "
SELECT BASE POINT :")) "R" A
(GETPOINT "
SELECT REFERENCE POINT : "))
"1'-5"")
View 7 Replies
View Related
Dec 30, 2012
I have been using the addin "Save Run Macro" to automatically run a macro every time the "Save" button is pressed.
Any of the following questions about "Save Run Macro"?
1] When I protect the macro from viewing (so I can protect my code) "Save Run Macro" does not see the macro.
2] When I save the part for the first time (ipt, iam or idw/dwg) the macro does not run. I always need to run the macro again.
View 1 Replies
View Related
Jan 9, 2014
Before when I was creating models the origin (0,0,0) was always set in the snap point i started the line in. Now suddenly something happend and now 0,0,0 is always starting in the Original XYZ point.
How do I get back to the old settings?
View 6 Replies
View Related
Dec 21, 2013
Inventor 2014 crashes when executing revision table edit. This started after installing windows 7 SP1(x64) and SQL server 2012 express (x64).
View 1 Replies
View Related
Jun 30, 2013
SurfaceBody.GetExistingFacets( ToleranceIndex As Double, VertexCount As Long, FacetCount As Long, VertexCoordinates() As Double, NormalVectors() As Double, VertexIndices() As Long )
This works fine in VBA (Inventor 2014). But when I start using the same in VB.NET (VS 2012) all declaration as long shows as integer and fails on compiling. If I change to integer compile passes but fail on executing in Inventor 2014.
View 6 Replies
View Related
May 22, 2013
Is this something easy I can do? Have my Macro Auto Open Upon Start Up?
Okay, so the simple macro i have been working on isnt just for personal use. We will use this macro all day long - but the issue is - my coworkers im sharing the macro with would prefer the macro open when program opens.
Now that i had set the macro's position down - how do i got about having the macro auto open upone start up.
View 6 Replies
View Related
Aug 5, 2013
I have a template that I have created, in it I have a rule that changes the stock number and description based on which sheet metal rule is selected. The weird thing is it works correctly if the first sketch is a rectangle. If you sketch a circular shape and make that the face it will not work. It blanks out the values for the stock number and description.
I'm running Inventor 2014 update 2.
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 33212 StartFragment: 314 EndFragment: 33180 StartSelection: 314 EndSelection: 314
SyntaxEditor Code Snippet
DimiPropValAsString=""
DimiPropDesAsString=""
SelectCaseSheetMetal.GetActiveStyle()
[code]...
View 1 Replies
View Related
Jun 12, 2013
Undo Command still turning off (disabled) constantly even after dumping the temp folder, and the turn off, turn on solution does not seem to work either.
Any solutions to this nagging issue other than re-install?
View 2 Replies
View Related
May 7, 2013
After getting Vault installed on our server and successfully setting up users and connections, I used the Library Transfer Guide to move our Content Center (including custom) to the Vault. I then changed the Inventor Application Options -> Content Center -> Access Options to Autodesk Vault Server.
This seems to have worked, as I can Place from Content Center when in an assembly, and it is pulling standard content as well as our custom files properly from the vault. However, in the instructions that I used for the installlation, it was suggested to stick with a standard folder structure within the Vault, namely two Library Folders named 'Content Center Files' and 'Libraries' and also a regular folder named 'Designs'.
I created those folders prior to transferring the library, as I thought they would be populated with the standard/custom content. This was not the case and I am curious when these folders come into play? *they are empty*
Also, today I will be attempting to 'Check In' a project to the Vault that I recently completed; does this usually maintain structural relationships between files?
Would you recommend using a single project structure in vault for two people? It seems, since we won't be working on the same project at the same time, having a single project would not be relavant to our situation..
Inventor 2011 / Windows 7 Pro SP1 64bit
Dell Precision T3600
Intel Xeon E5-1607 @ 3.00GHz
AMD FirePro V4900
20 GB Ram
View 7 Replies
View Related
Aug 16, 2011
Create a command (macro) to unlock all locked layers and remove the fade effect. I know how to unlock them by using the command LAYULK, selecting the entities on the locked layer. I have been trying to automate the command so I don't have to select entities.
View 4 Replies
View Related
Jun 4, 2013
Can I modify an existing viewport in a macro or in the command line?
Using a macro, I want to modify (specifically delete) the viewport from a layout tab after chspace from model space.
I have LT so no LISP. qselect works but cannot be put into a macro.
If I "select all" on a layout tab in paperspace ACAD says 1 of the objects selected is the viewport so I know autocad recognizes the viewport as a different kind of object.
View 6 Replies
View Related
Dec 23, 2011
So I can run the following code from the command line with no problem:
(WRK-Insert_Standards_Block '("S:\AUTOCAD\_Common\Linetypes\CSW_Civil-Linetype"))
(WRK-Insert_Standards_Block '("S:\AUTOCAD\_Common\Linetypes\CSW_Survey-Linetype"))
(WRK-Layer_Insert_all "CSW-X-FM_Layers_List")
However when I put it into a macro (custom command to be used from the ribbon) it spits out the following in my command line:
(WRK-Insert_Standards_Block '("S:
View 2 Replies
View Related
Jan 29, 2012
I'd like to pass and existing set of selection to a command like laylck, which asks for selections after beginning the command.
It must be possible to do this. Some CUI setup, lisp routine?
View 3 Replies
View Related
Nov 8, 2011
I'm putting together a simple lisp routine to issue bound, purged drawings.
I have code that will do the binding & purging but need handling the saving.
This is my approach :
(1) ask the user to save the drawing using this line (command "_saveas" "" "~")
(2) run a subroutine that binds xrefs etc (this works ok)
(3) run the QSAVE command
Trouble is, if the user cancels or hits escape during the SAVEAS command the subroutine & QSAVE will still run, overwriting the current drawing. How do I handle this scenario? Or should my appoach be different?
View 9 Replies
View Related
Sep 19, 2013
I'd like to change a layer's color from command line because of a user icon. I figured out from previous topics that I should use macro similar to this: ^C^C_filedia;0;-la;s;Verdeckt (ISO);c;1;l;dashed;;_filedia;1;re;
(I want to use this macro to change layer's linetype, too, but that's not the point)
The only problem with this macro: layer's name contains a space therefore Autocad tries to recognize Verdeckt as a command (and macro interrupts there) instead of setting Verdeckt (ISO) as the current layer. I've tried using different quote marks, none of them worked (' and " and <>). I hope there's a method for entering a parameter that contains space.
Software: Inventor Series 2011 SP1 x64
OS: Vista Business x64
CPU: E6400
RAM: 2*2Gb GeIL
VGA: Quadro FX 550
View 5 Replies
View Related
Aug 1, 2013
Main question: I need the user to be able to type a command. Then use it or cancel it. Then i need them to type another lisp command. In the second command i need to know (have the string of) the previous command they typed in. How do i get that string?
What I have tried.
I have looked at "LASTPROMPT" though not extensively, and i believe it would just return "ineedhelp" if i tried that.
I have looked at "CMDNAMES" but that gives the command you're currently in.
And I have found one page on this forum titled: Command Line History Macro, but there was no answer on that post.
I could create a global variable for that string, but then I would have to put the set code in every function I create. Nope, will not.
Backstory:
There's a person that is going to make how-to videos on how to use some of my lisp routines.
Anyhow, I need the user to be able to type in "ineedhelp" and the lisp that runs must get the last command's string go to the shared drive and pull up the video file for that command.
I have made a lisp that opened a word file before, and if i could get the string of the previous command, i'm fairly certain that I can get the videos to work.
There will be approximately 60 lisp routine video's.
View 9 Replies
View Related
Oct 22, 2013
It's a shame that Illustrator's scripting ability isn't as robust as InDesign's.
I have a script that goes through every path in a file and records all of the colors used in it. The problem is that it stumbles when faced with certain types of "PluginItem"s. I've been able to fix some of it, such as when it comes across a "Compound Shape" (as opposed to a Compound Path or other normal Illustrator object). In such an instance I can select the path, then call a menu command to expand that selection:
if (currentItem.typename == "PluginItem")
{
currentItem.selected = true;
app.executeMenuCommand("expandStyle");
currentItem = app.selection[0];
app.executeMenuCommand("deselectall");
colorsInUse(currentItem);
}
I had to do some scrounging to figure out how to execute that "Expand Appearance" command that is in the "Object" menu in Illustrator. In fact, the only resource I discovered was a list that is partially in Japanese. By the way, that last item in the list is a recursive call to the same function in which this if statement resides.
So, the above code works for "PluginItems" that can be rectified with a call to the "Object -> Expand Appearance" menu item. What about those that don't, such as an enveloped object? With those, I'd normally just run the command above "Expand Appearance", called simply "Expand…" Well, that menu items pops up a dialog which, when the user clicks "OK" on it, will properly expand the enveloped object so that the script can continue reading the paths that made it up and get fill & stroke colors.
I can call this menu item with a simple "app.executeMenuCommand("Expand3");", but my problem is that dialog which appears. I don't want the user to have to click "OK" on it every time it pops up when the script wants to expand that object, but the traditional "app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;" method doesn't work.
Is there any way to expand enveloped items without having a dialog pop up on the user?
View 9 Replies
View Related
Mar 31, 2010
I have a county wide aerial image in jp2 format, connected through Data Connect and every time I pan or zoom it says "executing query". It is very slow getting around in the drawing (tracing over tree line, roads, etc.). I have a Windows 7 64-bit machine with 6 GB of RAM. Is there a setting I can turn off to make zooming, panning, changing layouts, etc. faster?
View 3 Replies
View Related
Nov 25, 2013
I have a problem while executing intersectwith between polylines and lines
the polyline execute intersectwith method referencing a line object with expandboth parameter value but sometimes , the intersection is not found
when using expandthis or expandargument values, I have no problems
I'am using VS2012 express and Autocad 2014
the attached project containt :
an image (result;png) showing my result
a dwg file (dessin3.dwg) , it is my test file
the source code for testing , (test" command)
it find all polylines and all lines in the drawing , compute the intersections between each couple and draw a dbpoint on each
View 3 Replies
View Related
Sep 24, 2012
We create a greate deal of DLL add ins for Inventor using Microsoft VB.NET. The code security is very important to us. I hear certain program such " Lutz Roeder's Reflector " can reverse engineer the DLL assemblies and get the actual code from it. This would cause concern when we deploy the DLL to various users.
So, is it true that DLL from VB.NET (or C# and C++) is so vulnerable from reverse engineering? if yes, what is any practice to add security to it?
View 4 Replies
View Related
Sep 30, 2013
In a weldment assembly i place a symmetric, circular part, but later i want to drill holes in it, and i am afraid that i will accidentally rotate it.
Can i place a constarint that prevents it from rotating? there is no such possibility.
I can ground the part, but i don't like it since if there are modifications they might not be applied (i don't have experience in grounded parts)
View 2 Replies
View Related