AutoCAD .NET :: How To Remove User Interaction Part From A Code

May 14, 2013

I have got this code by KEAN WALMSLEY.His code will ask user to select a block and then list all of selected block's attributes. However, I need to tweak his code a little bit and instead of user interaction, the block has to be selected by its name and through my code.

Here is his code (with slight changes to suit my purpose):

rivate Sub ListAttributes()Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor Dim db As Database = Host Application Services.WorkingDatabaseDim tr As Transaction = db.TransactionManager.StartTransaction() Try Dim filList As TypedValue() = New TypedValue(0) {New TypedValue(CInt(DxfCode.Start), "INSERT")}Dim filter As New SelectionFilter(filList)Dim opts As
[code]....

 Now, I need to change this Sub to a Function as below:

Private Function ListAttributes (blockName As String) As Boolean

The aim is to list all block attributes if the 'blockName' exists in drawing and return True afterwards. Oppositely it should return me False and print nothing to Editor if blockName does not exist.

View 5 Replies


ADVERTISEMENT

AutoCAD Inventor :: User Interaction In VBA?

Jan 26, 2013

I have an assembly file with parts assembled, and I want the user to move and position the assembled part into a position as they desire, and then run VBA to extract coordinates information to do further calculation. 

So, what I want to do is creat a VBA code that does the following in sequence

1. VBA runs code to assemble the parts (I can do this)

2. go to the autodesk interface and allow user to manipulate the part

3. when user presses a key (e.g. "enter", "space"), the control returns to VBA

4. VBA run some code to extract the coordinates and do some calculations (I can do this too)

there is something like an input box that waits for the user to click ok, before continuing to run the rest of the coding. But I realise that the input boxes and message boxes do not allow users to work on the model in the background. Since I need users to move/rotate the part to the desired position, I can't simply use input and message boxes. 

View 4 Replies View Related

AutoCAD Inventor :: Use Custom Embedded Cursor - User Interaction Event

Aug 3, 2013

How to use an embedded cursor (mycursor.cur) via the SetCursor command under user interaction events. I can use built in cursors just not able to get it working with my resource.

Sample below throws an error type mismatch.

oInteraction.SetCursor(CursorTypeEnum.kCursorTypeCustom, My.Resources.mycursor)
 
I have set the build action of the cursor to be embedded.

View 3 Replies View Related

Illustrator :: Execution Of Menu Command Without User Interaction?

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

AutoCAD Inventor :: Mouse Interaction When Inserting Part Or Assembly?

Sep 14, 2012

I've been out of the programming game for a few years.  But, using the sample code to place a part or assembly in an assembly by placing it with the mouse should be possible in VBA.

View 1 Replies View Related

AutoCAD Inventor :: Sort User Parameters By Code

Apr 10, 2013

I work with Inventor 2011.

It is possible to sort Parameters (user parameters) by code (simulating a click on column header) ?

View 3 Replies View Related

AutoCAD Inventor :: ILogic Code To Create User Parameter?

Jul 29, 2011

I want to use iLogic to create User Parameters with Multi-Value lists filled with info from an excel spreadsheet. What is the code to create a new User Parameter?

i7-2720QM Dell Precision M6600, Win 7 Pro 64-bit, 8GB RAM
Autodesk Product Design Suite Ultimate 2013
Autodesk Vault Professional 2013

View 4 Replies View Related

AutoCAD Map 3D :: Get Color Picker To Popup Inline In Code To Get User Selection?

May 27, 2011

I am porting some VBA to VB.Net.

Several of the modules do a ThisDrawing.SendCommand("_color" & vbCR) to popup the AutoCAD color picker, then process the response by doing a ThisDrawing.GetVariable("CECOLOR") to get the selected color.

With .Net, the SendCommand does not execute until the .Net program ends.

How can I get the AutoCAD color picker to popup inline in my code so I can get the user's selection?

View 2 Replies View Related

AutoCAD Inventor :: Remove Part Form Part In Isometric View?

Oct 23, 2013

I order not to hide components, i want to make a break sketch and remove a piece from a part from an assembly in the isometric view in a drawing. can i do that?

View 4 Replies View Related

AutoCAD Inventor :: Save A Part With ANSYS Code?

Dec 3, 2011

I have build a solid in inventor. I want to optimize the model in ANSYS, so I need the ANSYS code of the geometry.  If I import a file into ANSYS (i´m importing .SAT and  x_t parasolid) the geometry code does not show.

how can I save a part in inventor with ANSYS code, or any way to convert any CAD format to ANSYS code?

View 1 Replies View Related

AutoCAD Inventor :: Code To Create Virtual Part?

Aug 16, 2013

code example of how in .iam create a virtual part and save it separately in specific folder?

View 3 Replies View Related

AutoCAD Inventor :: VBA Code To Get Coordinates Of Each Part Of Assembly

May 9, 2012

I try to develop a vba code to get the coordonates of each part of an assembly and after export them to an excel file.

I build this : 

Public Sub Export_Layout_COG()

If MsgBox("Cette Macro va exporter les coordonnées du COG de chaque layout, continuer ?", vbYesNo) = vbYes Then
Dim RefDoc As Document
Set RefDoc = ThisApplication.ActiveDocument
Refdocdisplayname = RefDoc.DisplayName

[Code]...

The code return an error on the red line, I don't catch why?

View 3 Replies View Related

AutoCAD Inventor :: Change User Parameters From A Linked Part

Jul 19, 2013

I made an assembly that adjusted to sized based on some key parameters. These key parameters are controlled by a form in the main assembly. The keys parameters actually adjust the skeleton file, which then drives the frame, then all the parts are adjusted.

after changing these parameters all necessary parts would adjust to size and keep the location constraints. Worked quite well.

The issue now is that, we adopted a new naming convention and this assembly requires all the part files to be renamed. I meticulously saved each part as their new name and then replaced each component in the main assembly. This worked to an extent. The problem that I am facing is that when I saved each part as there new name, the new part retained the linked parameters to the old part. Is there a way to change this link to the newly name skeleton file?

I looked into design assistant for this process as well, but the only changes I think available were to add a prefix or suffix. If worse comes to worse, I can remodel this project but, I am sure there has to be a way to alter this.

attached is a single part with those parameters in the image above.

View 2 Replies View Related

AutoCAD Inventor :: Including User Parameters In Part Description?

Dec 8, 2011

I have some parts with varies User Parameters that allow cusomization of part features.  With numeric user paremeters we can check the export parameter box and then, in the description of the part we can refrence that parameter.  For instance the description could be: =Width <Width>, Height <Height>, etc. Where it would desplay as Discription: width 22in, height 12".  

We also have text User parameters.  Is there a way to add these parameters to the description as well?  They do not have the option of checking the export parameter box in the parameters table.

View 1 Replies View Related

AutoCAD Inventor :: Add Specific User Parameters To Part File

May 21, 2012

I would like to have a rule that will add specific user parameters to a part file.  These parameters need to be formatted so the width, depth and thickness will control the description of the part.

IE:

Width=4

Depth=2

Thickness=3/16

DESCRIPTION = TS <Width>X<Depth>X<Thickness>

I would like to format each parameter so that the:

Format=Fractional

Precision=1/16

Unit string=False

This is what I have so far:

oMyParameter=ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters

oParameter=oMyParameter.AddByExpression("Width", "TOP_RAIL_WIDTH", UnitsTypeEnum.kInchLengthUnits)
oParameter.ExposedAsProperty=True
oParameter.Units="in"

[Code]...

The TOP_RAIL parameters are from a linked file.

View 9 Replies View Related

AutoCAD Inventor :: User-defined Part Still Appears Like Standard

Jun 28, 2012

After saving a part from libary as 'user-defined' to edit it, it still appears with the symbol for 'standard part' (blue T): Means I cannot move it around to sort the parts in the 'tree' or from a folder to another and so on.

Open the part and it has a normal component part symbol. But still not in the assembly. I sometimes cannot change properties in the parts list. The name is different from the name in the folder (pictures).

Second thing: Using 'copy' to copy a assembly into a new folder, the user-defined part still behaves like a standard part and will not be copied as a normal part. - Not exactly what I need, when I make a part 'user defined'...

View 2 Replies View Related

VideoStudio :: Remove Time Code In Video?

Oct 14, 2007

I want to remove the time code that leaves in the video and cannot. Since one becomes?

View 14 Replies View Related

AutoCAD Inventor :: ILogic Code To Check File Name Matches Part Present In Drawing

Feb 15, 2013

At my company we use part numbers as file names for everything. for example, part number 09090P00100000, will be saved as 09090P00100000.ipt and will have a drawing saved as 09090P00100000.idw.

Within the drawing template file, i want to set up an ilogic rule that will check that the part present in the drawing corresponds to the file name of the drawing. This rule will run after saving and will just display a warning if the file names do not correspond.

I just need some code that will get the file name of the part displayed in the drawing.  Note that we use iparts so the code must get the member file name and not the factory file name.

Dim oDrawingDoc As DrawingDocument
oDrawingDoc = ThisApplication.ActiveDocument  
Dim oSheet As Sheet   
oSheet = oDrawingDoc.ActiveSheet

[Code] ........

Autodesk Inventor Professional 2011
Windows 7 Enterprise, 64-bit

View 8 Replies View Related

AutoCAD Inventor :: ILogic To Change Feature Occurrence Upon Opening Part By User

Jul 9, 2013

I downloaded a model off a website, it is, (excuse my electrical background ignorance) a jumper for terminal blocks.Our electricians use these and cut them down to size as needed.

Is there a way to use iLogic and a form or message box, to prompt upon opening the part as to how many jumpers are needed for the current assembly> It comes stock with 10, but they sometimes only use 2, 3 4 etc. etc..

I didn't model the part, but I can if it will make the rule easier to write.My idea I suppose was to have the part modeled with 2 jumpers and then use ilogic to create more if necessary.

View 4 Replies View Related

AutoCAD Inventor :: Getting User Selection Within Part Edit Mode In Assembly File

Feb 24, 2013

I'm working on Autodesk VBA, and I'm trying to get user input on which vertex to use for a constrain. I want to make a macro that can go into part edit, allow user to select a vertex, and then automatically set up the constraint. Initially I wanted to do this in a single macro, using this short piece of code

while oSelectSet.Count <>1
DoEvents
Wend

While this worked when run directly from VBA, if I call it as a macro in Autodesk itself, the DoEvents doesn't seem o work because I wasn't able to make any selection at all. I googled and it seems like this is just how macros are.

So I split the code into a 2 subs and a function (as attached), and put them into separates rules that I call using a form in Autodesk. The first sub "Meta1Pin1_1" works, then I would select a vertex in edit mode. But when I go ahead and call the second sub "Meta1Pin1_2", I get the error message that I created which says no vertex is selected. But if I select a vertex and call the second sub again, it will work.

So I've been trying different things and I realize that every time when I first call the second sub, my selection is erased teh moment it goes into the sub. But, for some unknown reason, the selection will remain when I call it the second time. I can't figure out what exactly happened between the first and second call of the same sub, that allowed the selection to remain.  

' prepares assembly for user input by grounding bones and going into part edit
Public Sub Meta1Pin1_1()
Dim oDoc As AssemblyDocument

[Code]....

View 2 Replies View Related

AutoCAD Inventor :: Open A Assembly File / User Selects A Part / Plugin Automatically Runs

Feb 27, 2013

is it possible to write a plug in that runs when a user does something.example. you start inventor and open a assembly file the user selects a part and the plugin automatically runs.no pussing buttons, no quick key, it just runs.

View 2 Replies View Related

AutoCAD Inventor :: ILogic Code Part Iproperties To Custom Iproperties

Sep 19, 2013

I was looking for some iLogic Code for Inventor 2013 that would cycle through all the parts in an assembly grabbing the quantity of each part and setting it equal to the custom property "Qty" of each part.

Having a little trouble creating the for each loop and setting reference to each part without referencing each part by specific name.

View 6 Replies View Related

AutoCAD Inventor :: How To Remove Portion From A Part On Surface

Mar 21, 2013

How to remove a portion from this part.  I need the beige colored "lump" removed and it needs to be smooth with the other suffaces.

I can copy the surfaces and then do a patch, but the new surface does not look right.  It has a buldge in it.

Also tried "Delete face" which I use all the time, but it does not work here.

View 9 Replies View Related

AutoCAD Inventor :: Interaction Event Mouse Tool Tip

Jul 17, 2013

How to set a tool tip to show up next to and follow the mouse during user interaction. It's the same function that the CommandManager.Pick does?

If it's not a built in function then I guess it's created by a tool tip that gets moved around to follow the mouse on mouse move?

View 1 Replies View Related

AutoCad 3D :: How To Remove Inner Solid Part From Other Solid Part

Mar 14, 2012

I have to solids. They are intersecting each other, I want to remove one solid which is inside. It's a Civil 3D 2012 QUESTION.

View 5 Replies View Related

AutoCAD Inventor :: Project Sketch Onto Part To Remove 2mm Of Shape

Dec 7, 2013

is there a method to project the sketch onto the part so that i can then remove 2mm of that shape from the part....?

Inventor 2013 & Inventor 2014 (work)

View 1 Replies View Related

AutoCad 3D :: How To Remove Part Of Solid That Enclosed Within Green Surfaces

Jul 2, 2013

I've just started learning AutoCAD and came across my first obstacle I don't know how to work around. Here's what I'm trying to do.

I draw two lines and two circles and then trim the excessive parts as in the picture (in general it can be an area composed of various types of lines, straight lines, arc, and likely with rounded corners).

Then extrude to the height 2. This makes 4 surfaces (green). Now I build a solid 'around' the surfaces. In this example I draw a rectangle and extrude to the height 1 (red). And my question is: how do I remove the part of the solid that's enclosed within the green surfaces? Subtraction doesn't work as I don't subtract solid. Slicing doesn't work either as it's more than one surfaces. For the same reason I can't turn it into a solid.

acad02.jpg

View 2 Replies View Related

AutoCAD Inventor :: Selecting Profile Path Using Interaction Events

Jun 21, 2007

I am in need to select a profile path using interaction events. How can it be done? Is there any filters available for a Profile Path Selection?

View 9 Replies View Related

AutoCAD Civil 3D :: Parcel Segments And Feature Lines - Interaction

Apr 27, 2007

C3D 2008

Create Parcel Segments using the Slide Angle Create command
Create a Feature Line in the same Site that bisects any/all of the Slide Angle Create Segments
Save, close and reopen the drawing
Parcel Segments now terminate at the intersection of the FL

Not sure if this is as designed, and I don't recall this behavior in 2007. We have used FLs to assign elevations to Parcel Segments in 2007, looks like this is no longer possible.

View 3 Replies View Related

AutoCAD Inventor :: How to Remove Old part Number From vault View

Nov 29, 2011

I replaced a part in an assembly with a new part number, it shows the new part number in the browser. but when I switched from model view to Vault view, the old part number still shows there. I checked in and checked out the model assembly file, it did not work to remove the old part number from vault view. I also checked the BOM, the old part number is not in the BOM.

How can I remove the old part number from vault view? will it cause problem in the exporting BOM text file?

View 1 Replies View Related

Photoshop :: Freehand & PS Interaction

Feb 1, 2004

What method do you guys use for exporting Freehand(MX) files into Photoshop (CS)?
I've tried exporting as editable eps, psd(v. 4 I think it is) and simply to cut and paste, but everything comes out terrible when transformed from vector to pixel.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved