AutoCAD .NET :: Trying To Write Layer Gather And Change Program In C#
Aug 2, 2013
I am trying to write a layer gathering and changing program that will store a lists of layers based on layers they need to be changed to. I am writing it in C# and the part that is killing me is I need to store the old layers before I convert them so that way in the future the program will automatically know to change those layers to the appropriate layer.
I am trying to use an .xml file to permanently store the layers, and a serializer to read the layers into a dictionary so that I can search and see if I have already come across a layer.
I know that sounds very convoluted so let me simplify the problem. We have our layers which are only 7 layers. We get drawings from outside sources and they have their layers. Their layers correspond to one our 7 layers. We have a list showing which of their layers correspond to one of our layers. When we get drawings with layers we've never seen before, we need to search through the list to confirm it isn't already there and if it is not present, then ask the user to which of our layers their new layer should be associated.
I want to store the data in a xml file in a manner similar to this <ourlayertheirlayer> ourlayer1, somerandomthintg ourlayer1, anotherrandomthing ourlayer1, thisrandomthing ourlayer2, whatisthis ourlayer2, whoisthis ourlayer3, whycantifigurethisout ourlayer3, canyoufigureitout</ourlayertheirlayer>
Then I want to serialize the xml file and save the data in a Dictionary<string,string> type whre the first string is one of our layers and the second string is their layer.
I want the data in the xml file to persist between application sessions, but the dictionary would be filled each the program is started.Later in the program I will use the Dictionary to gather all the objects based on their layer, the second string in the dictionary, and convert them to our corresponding layer, the first string in the dictionary.
I am having trouble setting up my types in C# though. How do I create an xml serializer that will read ourlayer, theirlayer from an xml file and save it to a Dictionary. The data doesn't have to be in the xml file in that format either, I just can't think of an easier way than commas to sepearte the two pieces of data.
public class OursTheirs{ public List<string>[,] goToDict { get; set; }}public class oursTheirsComma{ public string commaPresent { get; set; }}public static class SerializeAddToDict{ public static string getFromXML(string xml) { XmlSerializer xmls = new XMLSerializer(typeof(string)); return xmls.Deserialize(new StringReader(xml)) as string; } public static List<string>[,] ParseXML { //Stuff here
I haven't figured out to convert the string to a //List<string>[,] where the first column is one of our 7 layers,second //column their layer } //Then some other stuff here to add the stuff to a dictionary}
I just starting learning C# and .NET.
View 5 Replies
ADVERTISEMENT
Jul 23, 2013
I am just starting to learn C# and .NET and I am trying to write a simple program to gather all the layers from a drawing in a directory, save them to a list, and use that list to change those layers to the appropriate layers. The way I want it to iterate is open the first drawing, gather the layers, ask the user which layer they want to change the original layer to, and when they select the new layer, it associates that old layer with the new layer so that in the future it won't prompt the user, it will just change it to that layer. Then it changes the layers and goes to the next drawing.
I wrote something very simple in LISP, but I need to make it more advanced and try to add in more features. Specifically I would like to be able to do everything in the background, without actually opening the drawings so I can avoid any user prompts or dialogue boxes.
I am at a complete loss at where to start though. There are so many members in the different namespaces for Autocad. Right now I am looking through acdbmgd.dll and acmgd.dll to try and find something useful, but I have no idea where to even start.
My guess would be to first define a method that gathers the layers from the drawing and saves them to an array. For example i would have multiple arrays for the different layers to which I want to convert the old layers, string [] 0layer, string [] walllayer that contains all of the layers to be changed to layer 0 and wall layer. Then I would compare the layers in the drawing to those arrays, if they are not present in any of the arrays, the program would prompt the user and ask which layers they want to change the existing layer to and add it to the appropriate drawing. Then all of the layers in those arrays would be changed to the different new layers.
At the very least, I am going to start making the different arrays to be filled. That much I can do. I'm just having trouble actually getting the data from the drawings.
View 2 Replies
View Related
Apr 24, 2012
Max 2013 now can't read or write final gather maps. I get an error cannot open map file. I have tried using a unc path \server name. I had the problem previously whan I moved to win 7 and I got around it by turning off my UAC. But that is off.
View 1 Replies
View Related
Feb 2, 2012
I'm trying to write a program in C# to automate ballooning from a BOM.The routine must read the BOM and for every row it highlights in all the views the corresponding component.Then the user must be able to manually draw a balloon or balloons to the highlighted items.
When done the next row of the BOM is called, etc.I can choose to start with a BOM from our PDM system or the Inventor BOM, partlist or drawingBOM
I tried different ways but I get stuck on it.I even tried to select the nodes in the browser and called oNode.doselect, but then I can't get the proper type for the selected items to go further?
View 1 Replies
View Related
Jul 25, 2013
I'm trying to write a script that renames a layer, and group within the layer, then an object within the layer (but not a part of the group) and have it run in a loop.
Here's what I've got so far, the group rename doesn't work.
#target Illustrator
var doc = app.activeDocument;
idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
function idLayers(doc){
[code]....
I haven't put in anthing to rename the single object yet since I cant even get the group rename to work. I suspect that the group re-name section isn't working because I'm either using bad syntax or an invalid command.
View 3 Replies
View Related
Oct 28, 2012
When you rename the layer and write the name of the letter "Б" is an error and automatically pressed "enter".When you click on a point in AutoCAD NumPad written comma.How can I avoid this problem?
View 1 Replies
View Related
Aug 1, 2012
I am trying to write a lisp routine that will make a layer called hatch, set it as current and then run the hatch command.
BUT the hatch command is not bring up the hatch dialogue box, it just puts things on the command line.
The layer is being made & set current.
The lisp is as follows:
(defun c:hh (/ ec)
(setq ec (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "-layer" "m" "hatch" "c" "8" "" "l" "continuous" "" "s" "hatch" "")
(command "hatch")
(setvar "cmdecho" ec)
)
On another matter, I have just found the bevel lisp routine by Terry Miller which works great BUT only for imperial measurements. How to make Terry's metric, that will work for metric measurements.
View 6 Replies
View Related
Jan 29, 2012
I wonder if it is possible to change the name of a file to a text layer automatically. is an example of what I'm trying to do.
I have a lot of photos then I intend to make a macro for editing it to make more precise the name of the file is saved in the image.
View 8 Replies
View Related
Apr 16, 2009
I am using Photoshop 7.0 on Windows XP
I have been watching a lot of how to videos to learn some effects, trying to pull off this one effect. In the end I would like to create an image file that will consist of a gray transparent rectangular box that I can freely write solid text on. I would like to take this image and "drop" it onto other pictures that I have so that it can serve as a description box. I would like whatever my picture is to be my background and then have this gray box file be the foreground so that I don't have to recreate this process for every image I want to add text to, I can instead edit my Transparent gray file with the text I want and then add it to the picture I want to have text.
View 2 Replies
View Related
Apr 16, 2009
I am using Photoshop 7.0 on Windows XP
I have hit a wall when it comes to trying to pull off this one effect. In the end I would like to create an image file that will consist of a gray transparent rectangular box that I can freely write solid text on. I would like to take this image and "drop" it onto other pictures that I have so that it can serve as a description box. I would like whatever my picture is to be my background and then have this gray box file be the foreground so that I don't have to recreate this process for every image I want to add text to, I can instead edit my Transparent gray file with the text I want and then add it to the picture I want to have text.
View 1 Replies
View Related
May 4, 2012
How to do it?
I am using Inv/Vault Pro 2011.
View 9 Replies
View Related
Sep 3, 2013
I need a lisp can change all elements in block to layer 0 except layer defpoint but still keep linetype, color as it is.
View 1 Replies
View Related
Apr 17, 2012
lisp..It work fine but just that i need some minor modificatio to it...At moment, when i activate the lisp, it will automatic select all dimension,leader and multileader to a layer call "DIMENSION"...Anyway i wonder if it is possible to prevent any dimension,leader or multileader in layer "Section" will not be change to layer "Dimension"?
View 2 Replies
View Related
May 31, 2012
I'd like to have/write a lisp to change all objects on layer "0" to layer "PC - Module"
If possible also;
save the document close the document open next in directory run layer changer program again.
View 8 Replies
View Related
Nov 10, 2011
I want to know if I have understand this correctly or not: layer previous undos the last change in layer related command. Then If my last action is on layer, unod command will do the same. layer previous advantage is when you want to perform an undo which is not your last action.
View 0 Replies
View Related
Oct 7, 2012
I'm running ACADLT 3102 on a new Dell xps and the monitor is set to the recommended 1366x768 screen resolution. When certain menus like hatch open up, the bottom of the menu area is off the screen, there's not scroll bar and no way to move the menu up to hit the ok or cancel buttons. I've been getting around this by going into the control panel and changing the screen resolution, then finishing the hatch command, and waiting for the default screen resolution to take over again!
Is there anywhere in the program to change the size/shape of the command screens?? Can't find anything in Options>Display....
View 8 Replies
View Related
Dec 20, 2011
I have existing multilines with linetypes set to byLayer, yet when the linetype on the layer changes, the Multiline linetype does not. Is there any way to get the linetype to change with the layer?
View 1 Replies
View Related
Jul 8, 2011
I'm trying to optimize the rendering time on pre-rendering my Final Gather map.
I've set it to every 5 frames and halved the resolution of my FG map compared to the final render but I'm wondering if some of the other roll-outs such as the Image Precision, Soft Shadows, Glossy Reflections and Refractions make a difference to the FG map. Can I knock these settings down a notch or two, or do I have to keep them the same as the final render?
View 2 Replies
View Related
Aug 19, 2011
After I installed design 2011 student version, I can't move the final gather presets or for that matter there are no presets available to change. And the values go erratic often. I switched to scanline and back to MR but that doesn't rectify it.
And also there are no geographic locations available in my daylight system
View 2 Replies
View Related
Sep 1, 2011
I am working with a network and it works for standard rendering.
I want to use it to pre-generate the FG maps. I have tried the "generate now" button, but that makes the FG calculate locally on the current machine... even with Net render checked.
When I try doing a render using the frames just as junk, it renders out, but does not save the FG map.
Working with max 2012 and Backburner.
View 1 Replies
View Related
Nov 15, 2012
If I generated FG maps with interpolation of every 3 frames and I use read FG points at every 2 frames. Would this be wasting my time? Would it be better if I just set it to 0? Once it starts rendering it comes up with warning signs saying it can't find specific FG maps which is understandable. Would max have to generate new ones (because this would be a waste of render time) and if it does can I somehow just tell it not to?
It is an animation that I am rendering (moving car and moving camera).
View 3 Replies
View Related
May 26, 2011
I've got a scene set up with a lot of objects (about 680 of them), and about a million polys. I'm in the process of trying to render out the animation and I'm running into some problems.
When I am attempting to recalculate my final gather maps so I can interpolate between frames and reduce flicker in the final animation, it is halting at different frames depending on what final gather settings I'm using, but halting with every setting I've tried.
This last time I tried it with "Low" default settings (.4, 150, 30, 0 bounces) and it stopped on frame 90 at 99.9% of "computing final gather points". With other settings it has stopped at frame 102 at 95.4%, and on another setting frame 87 at 66.5%. The most common percentage to halt at has been 99.9% of Computing Final Gather Points, but the frame number it halts on and the percentage varies.
The halt is repeatable and happens at the same exact spot in the animation depending on the settings. So if I use "Low" (.4, 150, 30, 0) it will always stop at frame 90 at 99.9% Computing Final Gather Points. The other settings will produce the same result over and over as well. I also attempted to re-start the precalculation from the frame that it halted on (after deleting the previous FGM file for that frame). Frame 90 still halts at 99.9%... or frame 102 halts at 95.4%... etc...
I can, however, get frame 91 to complete it's final gather map if I set the sequence to pick up on the next frame and go from there.I will attach an image of the model/scene I'm currently working on.
View 9 Replies
View Related
Oct 16, 2013
I was wondering if After Effects has a tool that can gather data from my renders and graph time spent rendering each frame?
For instance..
Frame001 took 2 seconds to render.
Frame002 took 25 seconds to render.
By using this data I could hopefully find problem areas in my comps. I am currrently using AE CC
View 1 Replies
View Related
May 21, 2012
Is there a PSD file viewer program that allows someone to toggle between Layer Comps so that one does not need the full blown Photoshop application to view layer comps in a Photoshop document or be limited to viewing only the default Layer Comp?
View 5 Replies
View Related
Nov 1, 2012
I need a program something that will allow me to insert colors to see what I want
View 2 Replies
View Related
Dec 28, 2012
when trying to access/apply a layer style (like "stroke" or "bevel and emboss"), i get a "could not complete your request because of a program error." this just started.
View 2 Replies
View Related
Jul 8, 2013
I have Windows 7 64 pro installed. Tried the CC on Windows 8 64bit pro and they didn't play well together. Windows 7 seems to work fine. Good enough. So, I have the 64 bit version of PS CC pinned to the taskbar. When I click on it, it opens right up. Then if I go to Lightroom 5 and open a file, it opens right up in Photoshop CC 64 bit. However, if PS is not open and I open a file from lightroom, Photoshop CC 32bit opens. Not what I want.
Ok, so you say go the defaults menu and change the default opening program? Doesn't work. Switches right back to CC 32bit.
View 4 Replies
View Related
Jun 19, 2011
I bought my PaintShop Photo Pro X3 on June 13, 2011, but when I installed it, the language in my program is Spanish, I want my program in English. How I can change de language in it?
View 3 Replies
View Related
May 4, 2013
I'm in OS X 10.8.3 working in Illustrator CS6. I have a MacBook Pro hooked up to a calibrated NEC PA271W monitor.
I've been working on some CMYK design documents with a mix of process and Pantone. All art was created in Illustrator and is vector. Everything was going fine, colors looked great and super-accurate as they always do with this monitor. Then...
I was exporting my design to PDF via Save a Copy. As I always do for PDFs I'm sending to a client for review, I chose to convert the colors to destination sRGB in the PDF options dialogue so they can be reviewed on screen.
Upon viewing the PDF using QuickLook in the Finder, I noticed that—rather than being converted to sRGB and looking pretty-close to the CMYK AI file—the PDF was extremely dull as if all colors had been desaturated 50%.
I tried other variations of the export and could not get the colors to look right (note: I did the exact same exports many times over the last week and they always looked great). Finally, I restarted my comp thinking perhaps it was just a temporary bug.
Upon opening my design file back up in Illustrator -- all the elements in the design file itself as we'll as ALL color palettes within illustrator had the same horrible desaturated look! CMYK proof preview was not turned on it affects all files, even those that worked perfectly in the past. I didn't knowingly change any settings in Illustrator (is there a make-all-colors-look-grayed-out shortcut I don't know about?!).
Things I've tried:
Trashed all custom color profiles and re-calibratedTrashed all ColorSync prefs and cacheRan ColorSync validation on all profiles, fixed those with problemsChecked that CS6 color was synchronizedChecked that all profiles on documents were correct (though I knew it wasn't this because of the random nature of the change.Restarted my Mac a bunch of times.Ran Onyx automated cleaning.
View 1 Replies
View Related
Jun 3, 2013
This just started happening recently after opening up an Illustrator file in Photoshop.
View 2 Replies
View Related
Oct 27, 2013
I would like to know how to change program language from danish to English - in Creative Cloud single-app membership Photoshop (one year)?
View 1 Replies
View Related