AutoCAD .NET :: Adding Custom Code In Reference Editing And RefEdit Command
Jun 6, 2012how i can add .net code on reference editing and refedit command.
View 4 Replieshow i can add .net code on reference editing and refedit command.
View 4 RepliesI have opened a block to add a quick leader only and when I tried to close I got the message cannot save back ... (see screenshot 1) when I hit f2 the problem is shown to be a missing application reference (see screenshot 2).
This may not seem a big deal but the problem actually occurred after about 15mins of editing a block and it has taken me about an hour to figure out what the culprit was
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:
i m designing a jali that has one panel and rest other mirrored of that particular module, but when i do reference editing of one module, other disappear since i'm editing one block. when i exit the refedit command those blocks appear again. is there any trick to enable view of all the similar blocks while i do refediting of one block?
View 9 Replies View RelatedHow can I add custom command (macro) to a context menu in Inventor 2010 via VBA?
(I searched the forum and got it to the point when I'm able to add commands that are built in Inventor)
Almost all of our blocks have dynamic properties and I've made a number of lisp commands that use this info.
How do I stop someone from using refedit command on dynamic blocks? I have a problem with one guy. I've explained to him many times to use bedit command or come see me and I'll modify the block. He continues to use the command
I do not want to use lisp to ruin his day... but I will if this continues. Any setting I can use to stop this and keep me from going to a dark place
I'm using Corel Draw X5 and I can't figure out how to add or edit colours in the CMYK (default) Custom Colour Palette. In X3 and earlier versions it was quite easy to add new colours and edit existing ones. I would also like to know how to move the order of the colours in the palette so that I can put one a custom colour near the top.
FYI I would like make these changes to the master / global CMYK palette, not just the one for a specific document palette.
When I drag a previous custom command into an existing custom tool bar and edit the custom command (then rename the command in the Name and Command Name) it also changes the previous custom command that I originally drug into the toolbar. What am I doing wrong?
View 2 Replies View RelatedIs it possible to code a custom linetype, so that it only follow certain annotation scales (e.g. 1:100, 1:200 1:500) and so that it just appears as a continuous line below and above these certain scales?
The solution should work even when the drawing is used by others and apply to both modelpsace and paperspace (viewport).
I'm looking at a way to edit the Application Options tab when a particular file is opened. For example, by loading file "template" it would set constraint options to a standard, set the background color of the application, etc. giving me a songle file to load my preferred settings.
For a first run example, need code such that when I open the file and run the rule, it would change the username from User to NWilson?
I'm very weak with the API code tools and structure, and I have zero VB experience. My train of thought is as follows:
Dim x = ThisApplication.GeneralOptions.UserName
If x = User
Then ThisApplication.GeneralOptions.UserName=NWilson
Inventor 2013
Win 7 Pro SP1 (x64)
I have a couple of VB pieces of code that set up the standards of my company. What I want to do create a buttom in my Workspace -within a tab created by me with the CUI tools- and trigger my VB code.
How is possible to create this buttom that is connected with my code and displayed in my workspace?
I have a couple of VB pieces of code that set up the standards of my company. What I want to do create a button in my Workspace -within a tab created by me with the CUI tools- and trigger my VB code.
How is possible to create this button?
Im drawing on autocad 2008, but im having some trouble with trying to explode an 'external reference' this external reference needs to be edited.
I opened a DWT renamed it and saved it as a DWG, then i used the INSERT/EXTERNAL REFRENCES/ATTACH DWG to bring in drawing. When i select the explode button i cant select the drawing i need to edit.
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:
// ENUM-PROPERTY INTERFACE METHODS DEFINITIONenum myEnum{ steel = 0, copper, wood};public void GetNumPropertyValues( int numValues ){ numValues = 3;}public void GetPropValueName( int index, out String valueName ){ valueName = Enum.GetName(typeof(myEnum), index);}public void GetPropValueData( int index, ref Object valueName ){ valueName = index;}
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 recently switched from LDD to Civil 3D 2010 and have since had problems with the command line recognizing Alt Codes when entering leader text. After the leader command is finalized, I am able to edit the MTEXT which does recognize the alt codes. I use alt codes for various symbols and now have to edit leader MTEXT each time in order for the symbols to be recognized. Is there a toggle or some other setting in later versions of AutoCAD that would allow recognition of alt codes at the command line?
View 2 Replies View Relatedi have problem with vba sendcommand method, which i use to send publish command. vba code doesn't wait to finish this command, but continues. i need to wait for finish publishing and then continue.
View 3 Replies View RelatedI would like to do something when my paletteset is closed. I took the C# code from here
[URL]
I modified the code to VB.net
Dim WithEvents ps As Autodesk.AutoCAD.Windows.PaletteSet <Autodesk.AutoCAD.Runtime.CommandMethod("psTest")> _ Public Sub PSTest() If ps Is Nothing Then ps = New Autodesk.AutoCAD.Windows.PaletteSet("psTest")
[Code]...
My code crashed. If I catch exception it is eInvalidInput exception. I don't know what to do as it is a simple code segment I don't know hot to fix it.
<Subassembly document name>” = iProperties.Value("Custom", "CUSTOMER P.O. NUMBER") iProperties.ValueInDoc("<Subassembly document name>.iam", "Custom", "CUSTOMER P.O. NUMBER")= Ucase(InputBox("CUSTOMER P.O. NUMBER?", "Create Customer P.O.#", iProperties.Value("Custom", "CUSTOMER P.O. NUMBER")))
View 3 Replies View RelatedI have created some custom button in VBA. I wish I can make those buttons toggling their image.
For example my custom button toggles Part/Component priority or Highligt on/off and I would like the button image will change showing the current state.
The background image color change will work too, or the some extra tiny mark on working sceen would be useful if it quite complicated to deal with ribbons.
Generally I need to see the current state at glance.
How can i interact with the source code of LOFT command.Especially, I'd like to inform me, about the method that Loft commad uses in order to draw a solid. I suppose that the two sketches I want to intersect, are close enough, thus the programm, can't generate the geometry...
View 2 Replies View RelatedI have not had any luck finding support on Auto Cad Architectures Keynoting w/ data base.
The issues I can't seem to resolve are: formatting the reference legend and saviing the format so I can re-use it in all my drawings creating a custom reference keynote?
I'm trying to find a way to add a custom button to my ribbon that will launch a global rule or form using VB. I know of a way using VBA but I want to get away from VBA. I'd much rather create an add with VB and use that.
I'm currently running IV 2012.
Where I can find the DXFIN command code? I want to examine it to see how it does what it does.
View 2 Replies View Relatedi'm looking to select a block reference, take it's wcs position, translate the coordinates to the current ucs and then create an xline using those translated coordinates. simple, right?
i simplified some code to test that i could properly build an xline in a current ucs. i just threw in static point3d values instead of grabbing them from another object. it worked as expected:
<CommandMethod("test")> _ Public Sub test() 'get the active document, editor and database Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acDocEd As Editor = acDoc.Editor Dim acCurDb As Database = acDoc.Database 'start a transaction Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() 'open the table for read Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) 'open the record for write Dim acBlkTblRec As BlockTableRecord acBlkTblRec =
[code]...
here, i revised the code so that a block reference's objectid is passed from another procedure, the origin is determined, translated to the current ucs and the points are tailored for the xline's basepoint and secondpoint. i threw in a few writemessages to ensure that the coordinates were indeed what i was looking for and they match up, but for some reason, the xline now fails to create itself.
'define the current ucs Dim ucsDesign As Matrix3d = acDocEd.CurrentUserCoordinateSystem 'start a transaction Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() 'open the connector block for read Dim acBlock As BlockReference = acTrans.GetObject(idConnector, OpenMode.ForRead) 'save connector origin Dim ptOrigin As Point3d = acBlock.Position 'translate the point to the current ucs Dim ptUcsOrigin As Point3d = ptOrigin.TransformBy(ucsDesign.Inverse) 'show me the block position acDocEd.WriteMessage(vbLf & ptOrigin.ToString()) acDocEd.WriteMessage(vbLf & ptUcsOrigin.ToString()) 'open the table for read Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) 'open
[code]...
i've rearranged this code multiple times, tried a couple different approaches, scoured the forums and even resorted to the less-than-elegant:
'create the xline Dim cmdString As String = "._xline " & ptUcsOrigin.X & "," & ptUcsOrigin.Y & "," & ptUcsOrigin.Z & " " & ptUcsOrigin.X & "," & ptUcsOrigin.Y + 1.0 & "," & ptUcsOrigin.Z & " " acDoc.SendStringToExecute(cmdString, True, False, False)
but i need to use the xline object after i've created it, so this sendstringtoexecute crap won't work.
When I'm into reference edit mode (REFEDIT) I can make match properties command also on objects which are not in working set - this was not possible to do before and it is pretty annoying. Is this a bug or some new function, hopefully turnable on/off?
Also I never understood, why is not possible to copy anything from reference edit mode, but it is possible to paste into, also there are no problems in Block editor mode? It seems to me like artificial set limit with no obvius explanation why would that be good especially when I see that it is possible to match properties on outside objects.
Having problems using custom pipe properties in pipe label expressions in 2013? I have some expressions relating to stub callouts and the ones that directly reference the custom properties lose that reference every so often.
For example I have and expression called "STUB-Riser-Length2d" which is defined as "{Riser Length} / SQRT(2)" where "Riser Length" is the custom pipe property. Every week or so it changes to "/ SQRT(2)".
I haven't been able to find the pattern as to exactly when this happens yet. All expressions not referencing custom properties seem to be holding steady. The pipe catalog is on a shared drive on the network, if that makes any difference.
Civil 3D 2013 - Windows 7 Pro 64 - Dell T3500 - Xeon 2.67 - 24gb - Quadro 600
I want to use the custom unfolding rules using Bend Compensation with an angular reference to the bending angle.
I have an Excel sheet where I have determined the bend allowance, the set back and from that, the bend compensation. When I compare these values to the values I get when using a K-factor linear unfolding method in Inventor, I get almost exactly the same results.
Tells me the formulas are working. So I implement the formulas in the custom equations. Exactly the same as in the Excel sheet. 10 degrees angle, great results! Yeah! 45 degrees, great results! More yeah! 90 Degrees, still going strong, I think I might make it!
100 degrees.... Fail! Every time an angle goes over 90 degrees, the result is crap.
I have been struggling with this all day long!! So in the end I completely erased the equations from the Inventor custom equations.I just say: Compensation is 1 mm. For all angles. This should no room for interpretation.
Again I try. I have a sheet metal part with two legs. A 100mm leg and a 50mm leg. Flat pattern should always be 151mm. Period.
Again, under 90 degrees and on 90 degrees, I get nice flat patterns. Above 90 degrees, it fails again.
Am I completely overlooking something obvious?? Or is Inventor really bugging on this?
I am working on 2012 SP 2
i tried to install 3ds max to my laptop so it can render while i do something else, but i have this mistake why?
DLL <c:program filesautodesk3ds max 2012stdplugshair.dlo>failed to initialize.Error code 8 - not enought storage is available to process this command
Part of my project includes a slider that is dynamically given a position. Because this all happens in code, I can't use the timeline tool to change the easing to something like "easeOutBounce."
This seems to follow the jQuery convention but results in the standard easing:
sidebarSymbol.$("slider").animate({top: sidebarSymbol.sliderPositions[scene]}, 750, "easeOutBounce", sym.playNext());
I need to place HTML code so that I can get a blogtalkradio graphic link onto my website. Can't figure out how to place the code so it will display the graphic.
View 1 Replies View RelatedI'm creating a window family by modifying a pre-existing one. One of the things I need to do is to move the reference planes defining the "left" and "right" edges of the window opening, so as to make to opening wider, but I'm not allowed to do it. The reference planes always move together, so that I'm stuck with a 3'-0" wide opening no matter what I do. I can't find any constraints linking the reference planes to each other or to a 3'-0" dimension - I can't find any constraints on them at all, in fact.
The file in question is attached. As I mentioned, the reference planes I'm concerned about are called "left" and "right". I have been able to move other reference planes in the file.