I am using Inventor version 2011. I wrote this code which tells me which object defaults style is active
Public Sub ActiveObjectDefaults()
Dim oDocument As DrawingDocument
Set oDocument = ThisApplication.ActiveDocument
Dim DrgStMgr As DrawingStylesManager
Set DrgStMgr = oDocument.StylesManager
Dim ObjDfStyle As Style
Set ObjDfStyle = DrgStMgr.ActiveStandardStyle.ActiveObjectDefaults
MsgBox ObjDfStyle.Name
End Sub
Is it possible to change Active Object Defaults Style by VBA code (see picture below)?
I am trying to change Object Defaults in order to temporarily switch style which use layers with different line weights, and than switch it back. I am new to VBA so I am not sure if I am not trying to do something what is impossible.
We have, as our standard library default dimension style, a 1/32 fractional style, called "1/32-FRACTION". Various Object Types, like Linear Dimension are set to this Object Style. When I create a drawing, then these Object Defaults are in effect.
This means that, doing nothing while executing a dimension command, I get fractional dimensions by default. This works good.
However, sometimes I want to create a drawing where the default dimension style is "X.XXX-DECIMAL" without changing the Object Defaults found in the style library. I've tried to make the changes from within the style library and then save this as a template. However, when I try to make a drawing based on this template, Inventor states that the styles in the template differ from the styles in the library" and then busily goes about undoing what I careful did.
So I'm hoping there is something in the API I can call on to do this with a macro. Is it possible to write a macro that after you start a drawing, flips all the various Object Styles from "1/32-FRACTION" to "X.XXX-DECIMAL"?
Any way to change the "View" of parts on file open? When I open an .ipt or .iam the Visual style view is always "Shaded". I want this to be "Shaded with Edges".
I am trying to change the default label styles for AddSegmentLabel under general styles using .NET...
Dim X As Autodesk.Civil.Settings.SettingsCmdAddSegmentLabel = CD.Settings.GetSettings(Of Autodesk.Civil.Settings.SettingsCmdAddSegmentLabel)()
X.Styles.LineLabel.Value = strChildStyleName ... says name does not exist
or
X.Styles.LineLabelStyleId.Value = oidChildStyle ... "The type of objectId is wrong"
If I manually change it to a child style and then check the values, they are the same as what I'm trying to set them to. If you use a "parent" style then these both work. Am I doing something wrong or this another limitation?
Civil 3D 2013 - Windows 7 Pro 64 - Dell T3500 - Xeon 2.67 - 24gb - Quadro 600
If I make a3d part, turn on the sky-background and illuminationand render the part AutoCAD does something odd. It defaults to perspective view and activates sky-background andillumination every time I save, or switch from a layout tab to model space. How doI get it to default to parallel view and 2d wireframe?
We own Civil 3d 2010 and are using the Map workspaces.
It seems Map is hard-coded to use the table style 'Legend' when inserting a legend table, yet you can modify the table style of the legend table after it has been inserted.
Is there a way to change the default table style from 'Legend' to something else?
How do you change the default text style (when creating a text object) in 3dsmax ?
Here is the scoop, I have successfully created attributed 3d objects in Autocad, exploded & convereted the attributes to text objects instantly via coding, then wblocking the text objects, importing them into 3dsmax via the Autocad Legacy importer with the group according to object selected, then in one shot coverted that group to an editable mesh (thus giving me filled in text).
It all works perfectly including text with thickness's, it retains itself as text objects in 3d studio and does not seem to overbloat the 3dsmax file (I typically have about 200 to 250 lines of text per job), this if for commercial interior design where I have many signs and walls with textual information that are the same sign but with different sayings, and also a few incremantal numbered stuff, so much easier to fill in in Autocad, some automatically via coding most as already mad blocks, then it is to do it TWICE, one for the cad drawings, then again for the the renderings.
Anyways, what happens is, the text comes in always ARIAL style, this is what I want to change, things I have tried so far:
1. Drew a text object in 3dsmax before importing, changing the text style to what I want, I said, this has to work, becasue when you go back to the create text dialogue in 3dsmax, the last style used remains as the new default. Imported the cad file, NOPE, Arial again.
2. Then I thought, maybe the actual style name in Autocad was teh problem, so I then renamed the style in autocad the to EXACT name of the Windows font file. Thats it, had to work, NOPE, Arial again.
3. Fruitlessly look in the 3dsmax options dialogue box, no default text style.
4. Tried to figure out how in the world I can select TWO text objects in 3dsmax and get the modify text modify panel so I can change more then one at a time, I dont know how to do that or if it even can be done.
What I need to know is if there is some sort of configuration file that I can edit that will allow me to change the default text style, I find it hard to believe that the word 'Arial' is hard-coded into the 3dsmax software or the Legacy Autocad importer, what if you didn't have that font on your computer ??
I will not have a problem changing that file for each font style I want to import, I will simply in Autocad split apart the different font styles to different layers, then change whatever I need to in 3dsmax then import each group of styles one at a time, no problem. I have already done 3 projects with my system, changing 200 or so text styles in 3dsmax one at a time, this has to end !
I've wrriten a script that will create custom annotative scales and a new text style. (It works fine up to that point) The next steps I'm trying to add to the script is to select a text object, set it to the new style, make it annotative and add all of the annotative scales to that text object. CHPROP allows me to make the text object annotaive but I haven't found a command that will let me change the style or add annotative scales to the text object. Any commands I can use in a script to do this ? (or know if this is even possible)? I have 2000+ drawings I need to run this one, I hope I can find the commands to script this with.
I am fed up with constantly changing the colour, justification, font and font size of text in sketches in the part environment. The text style drop down box is greyed out in the part environment so i can't set up a style and just change it.
Where i need to go to change what the default-iso style defaults to? Any registry key change i can use to make the test style drop down box available in the part sketch environment?
I created a template and changed some style properties. I can not save to master location and when I open the template is tells me it is going to override my custom style.
How do I save out my custom style to the defalut location?
This is probably a basic question, but in the control panel area, where it shows the measurements of an object created, the default measurement is in inches. Can I change that to display milmeters? I am aware that it can be changed in the rulers, but up where it says X, Y, then width and height, it shows inches. I want to view it in milimeters, because I am doing a project in milimeters. How do I do that?
I have a long document with text variable running headers along page edges. Behind each running header on the Master Pages, there is a black band. I want the color black to change to several different fill colors, when the running header changes, to define different "sections."
It's one document, no separate chapters or sections, at this point. See attached image.
Is there a way to tie the fill color of these colored bands to the running header so that it changes when the running header does? I think what I'm looking for is a way to make a variable object style (fill) to be triggered by the running header change. I have no experience writing scripts, but am willing to try. Plan B will be to unlink the master items and manually recolor on each page.
Can you have more "Object Defaults" then there is standards?I ask because everytime I create an additional one and don't have a standard for it to link to and I save the styles it disappears.
I declared a BOM as "indivisible" when I converted an assembly to a welded assembly and currently I need to show the BOM as "Only parts" to insert it in a drawing. There is any way to convert the BOM style?
I'm chasing the syntax on what i hope is a very simple procedure.
We have a project for re-design and manufacture here (Australia) of a machine that has been designed and detailed in one of our US offices. For this reason, we will be wanting all dimensions in mm etc, rather than inch.
My intention is to open the idw(s), update the styles library (done, i think...), change the active standard to "AS Metric" (got the code sorted for that too), and then change all dimensions to AS Metric.
So far i have each of these 3 processes in a different sub, called from a master. But my problem is in changing the style. I could change a dimension's style to match that of another existing style:
Set oGeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions.Item(1)
but I am having trouble setting is to the active style.
My module:
Sub ChangeStyle() Dim oIDWDoc As DrawingDocument Set oIDWDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Dim oDim As DrawingDimension Dim oDimStyle As DrawingStandardStyle Dim oGeneralDimensions As GeneralDimension
I have created a new drawing template, setup all border/title blocks and dimensioning styles as I would like. Save as a template and load it up from the 'new' menu, gives me this error and I am not clear on why since I set the details in it...
Not sure what the deal is but it resets my styles to default. Do I need to make copies of those default ones and set those as in my object defaults?
Below are 2 rules that run in succession to create and save a parts list from a base view in a drawing.
I am now trying to set the parts list style to a custom style, ideally while creating the list.
Also, I have to manually go into the list to turn off visibility of certain items (based on material), does I can do this with Ilogic? I ask because these steps precede a rule that automates placing base views of all parts in the parts list. If I could get the style and visibility right, I could automate the entire process.
Looking for changing such a style with ilogic?
Inventor & Vault Pro 2012 Windows 7, 64bit Core i7 920@2.67 8GB
CREATE PARTS LIST____ ' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the active sheet. [Code] .....
How to make a macro that changes the font for a specific Text Style. The name of the Text Style is eg. "3mm", which I want to change from RomanS to Verdana.
How can i change my default setting from picture 1 to a new setting like picture 2 when i open up a new part file and assembly file.Is there a setting i can change so whenever i open a new part file & assembly i have this setting as my default.
When i setup inventor 10 i choose to use inches, but now i want to use MM how would i change it under inventor 10 i thought it would bbe under options but it not.
How do I change the a part material render style within an assembly?
I have tried this below. It changes the name but doesn't update the render style. Sub Material()Dim oassy As AssemblyDocumentSet oassy = ThisApplication.ActiveDocumentDim ocompdef As AssemblyComponentDefinitionSet ocompdef = oassy.ComponentDefinitionDim ooccurr As ComponentOccurrencesSet ooccurr = ocompdef.OccurrencesDim opartdef As ComponentDefinitionSet opartdef = ooccurr.Item(11).Definitionopartdef.Material.RenderStyle.Name = "Red"End Sub
I received a rather large assembly file from a client that was done in Pro E. I was wondering if it is possible to change the entire assembly from Default material to steel without having to go into each individual part and changing its material manually (which could take several hours) I am using INV 2012 Pro with SP1 installed.