AutoCAD Inventor :: Finding Referenced Document Of Active Sheet
Oct 22, 2012
I'm trying to get the value of the Category iproperty of the model on the active drawing sheet. This is not a problem in a single sheet drawing, but I'm not sure how to specifically retrieve the Referenced Document of the Active Sheet in s multi sheet drawing.
Here's what I have:
Option Explicit
Public Sub PartsListFilter()
'set reference to the drawing document
'assumes that a drawing is active
Dim oDraw As DrawingDocument
Set oDraw = ThisApplication.ActiveDocument
[code]........
I am writing a external ilogic riule, which will iterate through all the referenced documents of the active assembly and write certain iproperties to a text file.
The code is below
It works in that the text file is created and it does write the iproperties. HOWEVER it only writes the iproperties from the active assembly
' go through all referenced documents in a assembly . Grab the description,title and part number iproperties
' and print out a list
If Not ThisApplication.ActiveDocument.DocumentType= kAssemblyDocumentObject Then Return End if
[Code]....
How can i fix this code so that it writes the iproperties for each oFileRef ?
I open my assembly and get this prompt."The material referenced in the sheet metal rule could not be located....."
There are several sheet metal parts in this assembly, so I am not really sure which part it is talking about. Would be good if it listed the part number so I could correct it. So I am off to find the one that is causing the trouble. I close my iam and open the first sheet metal part, no dialog box, so I assume its not this one. Close it, and open the next one. No dialog box, so I open the next one..... I continue this until I have opened all the sheet metal parts in this assembly and NONE show me the dialog again.... huh!! That was yesterday.
I come in this morning, start Inventor and open one of the sheet metal parts from yesterday and immediately get the dialog again. The problem is that this dialog will only appear ONCE per Inventor session.
Once I nailed down the offending part, I then tried to find the offending material. I dont really know what this dialog is telling me cause the materials for the rules are stored locally in the part. Why is it even trying to reference a material in the library?
I am creating a program to write out all the flat patterns of all sheet metal parts in an assy. I save it out as dxf. What I need is to totals of all the sheet metal parts across all sub assy’s etc in other words not “Structured” but “Parts Only” in Inventor BOM terms. All works fine but the only problem is that when a sub assy is a weldment or “inseparable”, it hides the parts inside it and “Parts only” BOM don’t make the internal parts of that sub available and the totals are not correct then. I need the totals because the idea is to write that into the file name including the thickness of the part.
First, it requires there to be a prompted entry text box in the title block named <SCALE>, is there any way to write to a textbox that is not prompted entry? The prompt when a new drawing or sheet is created is misleading and makes users think they need to manually fill out the prompt. Secondly, this code works on multi-sheet drawings but it concludes by making the last sheet active. Since we are triggering this rule before save it's a nuisance to have the drawing switch sheets everytime you do a save. Ideally, the current active sheet should remain active when the rule runs. Here is the
For Each oSheet In ThisApplication.ActiveDocument.Sheets ActiveSheet=ThisDrawing.Sheet(oSheet.Name) If oSheet.TitleBlock Is Nothing Or oSheet.DrawingViews.count=0 Then Exit Sub oTitleBlock=oSheet.TitleBlock oTextBoxes=oTitleBlock.Definition.Sketch.TextBoxes [code]....
I'm trying to write a VB.Net program (Visual Studio 2010 Express) for Inventor 2012 that will add up the length of all the edges of a flat pattern including any cutouts/holes in the part. I need the total length to do an estimate on the amount of time required to cut out the pattern on a laser. How to get this info programatically in VB?
i7-2720QM Dell Precision M6600, Win 7 Pro 64-bit, 8GB RAM Autodesk Product Design Suite Ultimate 2013 Autodesk Vault Professional 2013
I am trying to add sheet numbers to my template for my document. I know I have to use the Sheet Properties, Sheet Number then Drawing Properties, Number of Sheets but I cannot remember how to do this? I am using IV 2010. There used to be a Properties Field icon, but now I cannot find it? I RMB on the title block, select "Edit", then selected the location of the property, then selected Sheet Properties, Sheet Number, but nothing shows up.
How can I stop changing active document? I was thinking I could use this, but I don't know how to cancel it in the event handler:
AcadApp.DocumentManager.DocumentToBeActivated += new DocumentCollectionEventHandler(DocumentManager_DocumentToBeActivated);static void DocumentManager_DocumentToBeActivated(object sender, DocumentCollectionEventArgs e){ // Messagebox to ask if user are sure bool AreYouSureYouWantToChangeActiveFile = MessageBox.... if(!AreYouSureYouWantToChangeActiveFile) //cancel change active file somehow...???}
I would like to turn off all the existing layers in active document. I have found in developer's guide how to turn off one layer with specified layer name but can not apply it on all layers with any layername.
I tried to get all the Object ID's in layer table and then for each object turn layer off but seems that it does not work.
<CommandMethod("FilterLayers")> _Public Sub FilterLayers()'' Get the current document and databaseDim acDoc As Document = Application.DocumentManager.MdiActiveDocumentDim acCurDb As Database = acDoc.Database'' Start a transactionUsing acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()'' Open the Layer table for readDim LayerTable As LayerTable = acTrans.GetObject(acCurDb.LayerTableId, OpenMode.ForRead)Dim LayerTableRecord As LayerTableRecord = acTrans.GetObject(LayerTable.ObjectId, OpenMode.ForWrite)For Each ObjectId In LayerTableLayerTableRecord.IsOff = TrueNext'' Save the changes and dispose of the transactionacTrans.Commit()End UsingEnd Sub
Is there event for change current (active) layer of document?
(it's not Database.ObjectModified - it's not raised).
I tried to do it with binding as:
public void Initialize() { var layerList = Application.UIBindings.Collections.Layers; layerList.PropertyChanged += new PropertyChangedEventHandler(LayerList_PropertyChanged);
And -= in Terminate, but... Autocad 2012 chashed _sometimes_!!!
Impossible to understand when it happened. So I reject this way. Is there other way to handle this event?
I have an external drawing processor and one of the functions is to read the layers in an AutoCAd drawing and if the name matches freeze/thaw it. With modifications over the years I have had it working with 2002 through 2008. Now I'm getting errors. When I tru to use the Interop, I get "Call Rejected by Callee" errors, when I use the
ApplicationServices method to get the application and active document, I getI" Method 'GetEnumerator' in type 'Autodesk.AutoCAD.DatabaseServices.LayerTable' from assembly 'Acdbmgd, Version=18.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation." errors.
Basically for the interop method I use this
Imports Autodesk.AutoCAD.Interop Public Function GetAcadApp() As AcadApplication Dim progID As String = My.Settings.strAcadProgID Dim acApp As AcadApplication =
I'm trying to change the active document window size with vb.net. This seems like it should be straightforward, but I'm having some trouble. Below is some code that I tried to use which I found on the AutoCAD DevBlog.. I thought I understood how this works, but I can't seem to import the correct references to make it work.
Dim doc As Document = Application.DocumentManager.MdiActiveDocument() Dim docWindow As Window = doc.Window Dim size As Size = docWindow.Size docWindow.WindowState = Window.State.Normal docWindow.Size = New Size(500, 500)
I am writing a program acts on the current drawing by using data in the SSM. If the current drawing is found to be a member of a sheet set (using sysvar SSFOUND) it cycles through all the sheet in the sheet set looking for a sheet entry that matches. Sometimes a match is not found because the layout name in the SSM does not match the layout name in the current tab (sysvar CTAB). Is there a more directly way...and one that works? I just need a reliable way to get the AcSmSheet object the correlates to the current drawing.
Have been working on a little something and would like to know what units the user is using in their document. Basically what is selected here:
The thing is, no matter what is there (and while all other menus and such use the units) Active Document.unit stubbornly returns inches. Is there a way to get the proper ones using VBA?
Is there a script to convert a layer or layer group to a 32-bit image rather then the entire active document at present that is the only option in Ps 5.x.
It does almost what I need it to do. except that it also copies the ".ai" in to the layer name. Is there some way to modify this script to have it exclude or delete the file extension?
Apparently, in the CS3 is impossible to do any scripting and using any actions. Can it be done using plugins sdk, without creating a new document? I tried using the functions SetPageSetup and SetCropBox but no effect
I am finding missing fonts when I publish a PDF document from InDesign CC file.I tried to install the custom fonts in my system, but the installation is not getting completed.
I am using the fonts like, Akzidenz-Grotesk and Helvetica family fonts.
I have a 2 part assembly on a drawing. When I use the following code, checkFilename is giving me the full file name of one of the parts instead of the full file name of the assembly. How can I fix this?
Dim checkBalloon As Balloon Dim valueSet As BalloonValueSet Set valueSet = CheckBalloon.BalloonValueSets.Item(1) Dim checkFilename As String checkFilename = valueSet.ReferencedFiles.Item(1).FullFileName
I have placed an subassembly into another assembly that I am working on. This sub was then chagned to be a "reference". Now in the idw, I would like to pull a leader to the subassembly and I want the text in the leader to say what is in the "Title" Property of the subassembly. When I change the format of the leader text to be Type = "Properties-Model" and Property= "Title", I get the title of the part in the subassembly, not the title of the subassembly. It is like the subassembly is a phantom assembly, but it is not. The workaround is to manually type in the text, but this is a mistake waiting to happen.
Is there a way to get the leader to note the title of the subassembly correctly.
I have a FG assembly that shows errors. The parts referenced no longer exist, but it still tells me there are errors on the sketches. Since the parts no longer exist in the assembly, or anywhere for that matter, how can I get rid of this error? I have tried making parts and naming them the same, which it allows me to do, but no luck in resolving the error. I can include the assembly but it is 63MB compressed and am running 2011.
Inventor 2011 Intel Dual Xeon E31225 @ 3.1 GHz CPU 16 GB RAM NVIDIA Quadro 600 GPU Windows 7 - 64 Bit
How do I make referenced components from parts and assemblies? (I searched the web and it said that that you can change it in the iProperties by selecting the Reference tick box under the occurance tab - but no such thing exists in Inventor 2011!
what im trying to do is select a face in an assembly and create a sketch on it in the part level
this is just one step in the program im trying to make the overall program will create a tube frame and the tubes will be driven from a base solid
Sub test1() Dim asmDoc As AssemblyDocument Set asmDoc = ThisApplication.ActiveDocument Dim asmDef As AssemblyComponentDefinition Set asmDef = asmDoc.ComponentDefinition [code]......