AutoCAD .NET :: How To Implement Drop-down List (based On IDynamicEnumProperty) In OPM
May 25, 2013
Is there somone who can explain/show a sample of how a custom drop-down list in OPM can be implemented? Based on some articels by Kean Walmsley, I have successfully implemented categorized properties in the OPM using a .NET wrapper and C#. I have a class imlementing the members of the IDynamic EnumProperty, ICategorizeProperties and IDynamicProperty2 interfaces (based on ObjectARX 2013).
However, I do not really understand how to code custom drop-down list using .NET wrapper and OPM. I am using AutoCAD 2013 and 2014. I have read a lot of posts regarding OPM but there was no useful information in regards to create custom drop-down lists.
Inventor 2012.how would I input the total quantity of doors in the .iam in order to update the Parts List quantity column? I have a lot of user inputs in the .iam file set up to change width, height, etc that are based off of Parameters in the .iam, but I don't know how the user can enter assembly quantities in order to get the Parts List to update the Quantity column correctly?
I have attempted using custom iProperties but how to get it to display based off a user input Parameter.
I have a macro that I acquired somewhere (possibly these boards, can't remember now) for placing a parts list. I have modified it somewhat to change the location on the sheet where the list gets placed, as well as a sub that starts the autoballoon command afterward.
The macro is set up to place the parts list in the upper left corner, by adding the parts list width to the Mini Point of the border. This works perfectly well, except that we have two parts list styles, and they are differently sized.
What I would like to do is have the macro detect the parts list style, and change the offset value depending on which style it finds. I am an extreme novice with the API, who basically knows just enough to tweak sample code a bit, and have not been able to find anything close enough to use as an example.
How I should go about this, or even post some samples of something similar? Current code is shown below.
Public Sub CreatePartsList() On Error Resume Next ' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument Set oDrawDoc = ThisApplication.ActiveDocument 'Set a reference to the active sheet. Dim oSheet As Sheet Set oSheet = oDrawDoc.ActiveSheet ' Set a reference to the first drawing view on ' the sheet. This assumes the first drawing ' view on the sheet is not a draft view. Dim oDrawingView As DrawingView Set oDrawingView = [code].......
The macro does not have to set the parts list style - that is controlled by the drawing Standard. It just needs to detect what it is, and place the list accordingly.
I have created a generic title block for all my drawings and I have some attributes for the block. Is it possible to have a drop down list for an attribute so I do not have to type in the value/text each time? If so, how?
I want to be able click on 'customer 1' or customer 2' ect. and not have to type it in the attribute.
I am mainly developing for AutoCAD 2013/2014 how to implement a custom property as a drop-down list using OPM and .NET/C# wrapper. I have successfully created categorized custom properties already and can read/save them in XRecords via the OPM. I further implemented the members for IDynamicEnumProperty (using an ObjectARX DLL) in .NET/C# which are:
And I have implemented the GetCurrentValueData() and SetCurrentValueData() members in my .NET/C# wrapper as per the IDynamicProperty2 interface as following:
public void GetCurrentValueData( Object pUnk, ref Object varData ) {AcadObject obj = pUnk as AcadObject; if ( obj != null ){using ( Active .Document.LockDocument( DocumentLockMode.ProtectedAutoWrite, null, null, true ) ){using ( var tr = Active.Transaction ){ObjectId ObjId = new ObjectId( (IntPtr) obj.ObjectID ); DBObject DbObj = tr.GetObject( ObjId, OpenMode.ForRead ); if ( DbObj != null ){try {if ( [code]....
This code compiles without error but instead of the expected drop-down list the OPM only shows a field where I can enter or edit integer numbers, but there is no drop-down list when clicking on the field....
I have a very complex graphic with many elements and I would like to find a way to hide layers based on a list. In the documentation that there is a way to tell if a layer is hidden, but didn't see anything about a way to actually to control the hide/unhide property. Is this possible?
I have been making a title box for my drawing layout and have been using attributes. all my attributes open in the 'Enhanced Attributes Editor'. But for my Scale option, i was wondering if there was any way of creating a drop down list in the enhanced attributes editor instead of typing the value in each time?
where the setting for the size of type/font preview drop down is located in CS6, it used to be located under pref->type->type preview - but apparently not anymore. I'm probably "blind", they surely did include this option in CS6?
(A thing I find annoying in CS6 is how short the font drop down list is, only covers 1/3 of the height of my resolution, even though I have hundreds of fonts activated - requires a lot of scrolling! I really hope this gets larger if it is possible to have larger previews)
I have bought the hard copy version of corel draw Suit X5 and waiting for it. I originally dwn loaded it from the web and so did my son. We are working on a project together. He found TT-Musical Symbols in his dwn loaded version and I do not have it on my dwn load version. Do you have TT-Musical Symbols in your drop down text? and or when you dwn loaded the trail version, have you got it?
I'm building a script that will open a dialog box allowing the user to select a font family from a drop down list (not a list of all of the fonts), and then compare that value against the fonts that are in use, highlighting everything that doesn't match. I have not yet built the dialog, but I've got everything else working as I want except the list of font families.
The following code loops through the list of fonts (only 20 for testing purposes), compares the family name to the previous on the list (error trapped for the first loop), and pushes the family name (if it doesn't match the previous) into an array which will be used in the dialog box. With the two alerts at the bottom (for troubleshooting), I expect the alerts to show the same family name. For the first three fonts they do, but after that the array value is "undefined."
var iCount = 20; //var iCount = textFonts.length; var nameHolder = ""; var nameArray = new Array();
[Code]...
Questions:
1) Any speculation on why this behavior is happening (it isn't truetype versus opentype)? 2) Is there a better way to get the list of font families without duplicates?? 2) Is an array the best way to populate a dropdown list in a JS dialog box??? [this will be my first dialog with a dropdown, the others have user-typed values]
EDIT: Additional Info When it reaches the ninth font in the list, the above script starts writing undefined, but when tested manually, as below, it works fine. Hmmm.
alert (textFonts[9].family); var nameArray = new Array(); nameArray.push(textFonts[9].family); alert (nameArray[0]);
EDIT: More info tried replacing nameArray.push(familyName); with nameArray.splice(i,0,familyName); bad behavior remains
I used a little bit Civil 3D 2013 for railway design purpose. I understood all the basics but I still have a question : how to implement a railway with double track? In the library, there is only SingleRail subassembly. I'm not sure how to implement what I want or if it already exists in Civil 3D 2013. I found a topic (2006) : [URL]
Any good numbering systems that they currently implement in product design, rather than the conventional architectural numbering system mostly seen on websites and forums.
I have a stack of images that constitute a smart object and would like to apply a stack mode of random. Random would randomly select one pixel from the stack and bring it to the top, go to the next pixel location and do the same, and so forth.
For example, if the stack was 5 layers deep, one of the 5 pixels would be randomly selected, without median, averaging, or any other merging algorithm applied.
wondering how to implement the many facial expressions from facegen to 3ds max to use as morph targets for facial animation. fairly new to max animation.
im still trying to make a minigun following the tutorial but ive run into a problem, in the tutorial the "paint object" tool is used to implement screws into the model and make it more realistic. i have 3DS MAX 2010 and i believe that tool was introduced in 2011. what should i use instead? is there a plug in or something to get that tool in 2010? or is there some other way i should go about this?
remember im not continuing with my tutorial until i get past this speedbump
SKIP TO 15:10 TO SEE WHAT HE IS USING PAINT OBJECT FOR
I have some blocks (different exit signs) in a drawing. I want to make a table or excel sheet that sums up the number of equal blocks in the drawing. How can i make this?
I client has sent me a design created in Photoshop and would like to use the scrollbars he designed.
My questions is, how do I implement those scrollbars? I will be splicing the content areas out. I have designed and spliced many web pages but never scrollbars.
Is there a way to modify the DEFAULT SCALE LIST to show a metric scale list in an imperial template? I mean, I start a drawing using the imperial template, but i want to use the standard metric scales on paper space. on previous versions the scale list shown both imperial & metric. Now it depends of what the template is using.
I use a setup with Shader List (Volume) with two mists. One regular and one to blur out the horizon. After working on the scene for some time I notice that the shader list now contains eight copies of the last shader. I think I would remember if I did that. So, whats up with the shader list?
I have a curve which is a set of lines and arcs.This is present on a layer. code to filter these objects based on layer.I also need to convert all the object ids to a single entity.
Is it possible to do Thematic based on attribution display for a layer.
For eg: I have a layer called CIty with object data for name, country, etc. I would like to display a common symbol for all city points in ASIA, a different symbol or color for others etc. how can it be done with autocad.