Jump to content

Musisback

Member
  • Posts

    154
  • Joined

  • Last visited

Everything posted by Musisback

  1. Thanks Miguel, this way is much easier...
  2. Thanks for the info. I actually found some work around. (like we need to do too often in Vectorscript and more generally in Vectorworks...) Created 2 functions : The First one calculate the size of the future string, the second assign it its new value. so we got: Allocate theLongString[1..getNewStringSize(theLongString,....)] ModifyLongString(theLongString,....); This is not pretty, this is not efficient, but it works. PS: I now get those "reALLOCATING may cause lost of data" warnings that I cannot get rid off. I guess it is possible with some other extremely unpractical work around....
  3. I reask my question because it kinda went out of subject. I added a couples line to the TestString procedure to help me explain PROCEDURE TestString; VAR shortstring : STRING; aString : DYNARRAY[] OF CHAR; PROCEDURE ChgText(VAR varString: DYNARRAY[] OF CHAR); BEGIN varString:= 'The string has been modified'; END; BEGIN aString:= 'Only 13 chars'; ChgText(aString); shortstring := aString; Message(shortstring ); END; run(TestString); This procedure display : The string ha so, only the 13 first chars. It thing it is because then dynarray of char, like any other dynarray is allocate before the ChgText procedure : 13 chars when passed to a string, only the 13 first chars are taken into account. Is there a way around this ? Thanks,
  4. Thanks Dworks, So if I want modify a dynarray of char with is procedure, I need to 1 run a funtion that calculate the future size of the dynarray 2 reallocate the dynarray 3 run the function that modifies it. Is that correct? I guess it is possible, but not very practical or efficient...
  5. String contain a maximun of 255 chars. I need functions that process much longer strings, so i use dynarray of char as parameters. But I seem like is is impossible to allocate any type of dynarray given as parameter inside a function or procedure. ( the strings functions allocate automaticly the array of char but VS won't return the resized array ouside the procedure) So how is is possible to prosses longstring in a procedure ??
  6. Thanks, I have another probleme now though. I cannot change the class of a layer link with the procedure setclass(LayerlinkHandle, classname). weird....
  7. I would like to get the source layer of a layer link from script. Is it possible? How? Thanks,
  8. Thanks, michaelk. But there is something I don't understand in your file. There are viewport on design Layers? I thought this was not possible. (even thought is would be similar with layer links)
  9. Is it a way or a other module or version that allows to get at the same time different views of the same objects. For example, my screen could be spit in 2 parts, the first one would display the plan view, and the second one would display a isometrics OpenGL view. Or one part with the front view and the second on with the side view. That configuration would also allow to have different zoom for the different views. I works with cabinets, and I need to change the view constantly so that would be very helpfull. Thanks,
  10. Well, it does not allow to get the present snapping status. I guess it is just not possible in VW 2010 (in vectorscript)
  11. Sadly, they are not available... Is there another way?
  12. During the use of a tool, I would like "Snap to working plane" to be set on. I found out that is was possible to set it on with setConstrain('R'); but then I set all the other contraints off. I would actually like to set everything back as it was before the use of the tool. But I cannot get their status. I can get some of the snapping options as "Snap To Grid" with getpref, but not all of them How can I do? Thanks,
  13. I have PIO's that set there position from the position of other objects (parents). So in there scripts, there is a move3Dobj(objhd, ...) procedure. were objhd is the PIO itself. it works pretty well, but for big drawings with a lot a different object, changing the position of some objects result in reseting of a lot of other ones and that can take time. (up to a several seconds) I found out that when an object is moved by the user the object script executes twice. The first time because it was moved. so it reset there position by calling the move3Dobj procedure. And a second time because it was moved by the first execution of the script. So I wonder if it is possible to disable the 'reset on move' of a PIO from a script.
  14. I know that it is possible to display red messages in the message bar like the tool 'move by points' displays when nothing is selected: "Use the alt key te select an object". PROCEDURE AlertInform( text :STRING; advice :STRING; minorAlert :BOOLEAN); But is it possible to display green messages like "Autosave reset counter reset" or "Autosave suspended for this document"? Thanks,
  15. Ok, maybe Wall is a bad example. Connect/Combine is a better one. It is clearly a Tool, not a "object"-tool. So it is possible in build-in tools, but not in plug-in tools to start whit some kind of red highlighting (as trackobject) ? Actally, trackobject require a click. so why won't is works to begin the script? Other procedure that require a click work just fine to begin a tool sript. (Getpoint, Getrect, ....)
  16. I want to start a tool with the function trackobject (red highlighting). But I need to click on the drawing first before the 'object tracking' really starts. How can I do to make it start right away? NB: A bunch of build in tools do it (ex: wall) Thanks,
  17. Thanks, Josh, I'll try this way. Miguel, I don't have the symbol's name. I want to get the handle of any symbol currently be edited by the user. if I had the name, it would indeed be easier.
  18. My plug-in processes selected object this way: H:=Fsactlayer; While (H<>nil) do BEGIN ............ ............ H:=nextSobj(H); END; I want it to work also in symbol definitions while in editing mode. I tried with H := FInSymDef(ActSymDef); But It does not work. FInSymDef seem to return the last new symbol definition and not the active one. Is there a way to still make it works?
  19. Ok, I understood what is going on: The RGB stored in the record of the texture is a shortint The function RGBToColorIndex expects longint. ( like the longints that GetFillBack returns.) there is a 257 factor between the two kinds of RGB. so, I can get the name of my color with the script : R:=num2strF(GetRField(TextureHandle,'NNAPlain Color','Color')); G:=num2strF(GetRField(TextureHandle,'NNAPlain Color','Color G')); B:=num2strF(GetRField(TextureHandle,'NNAPlain Color','Color B')); RGBToColorIndex(r*257, g*257, b*257, colorID); ok := IsUserColor(colorID, colorName); But, there is another problem. IsUserColor only returns a name when the color is a color of the active document. And VW does not import the colors of the texture as 'active document colors'. So is looks like the only thing I can do to get the name of the color of a texture is to have all the colors in my document template. Does that make sens? Did I miss something? Thanks,
  20. Well it does not work. It looks like the color is stored with a integer (short) in the record of the texture. So information is lost. When RGBtoIndex is found, it is slightly different of then correct one. By correct one, i meant then one a get with GetFillBack(obHd, red, green, blue); RGBToColorIndex(red, green, blue, colorIDX); ok := IsUserColor(colorIDX, colorName); When then FillBack is the same color. In this last case GetFillBack returns longint. Then, there is no lost of information. Any Ideas to go around that problem?
  21. I am pretty sure I read somewhere that it was possible to choose how a PIO looks like when selected. (Orange Lines different that the object shape). Well, I cannot find out where I saw that. If someone know where is that doc, please let me know...
  22. I would like to know if it is possible to get the name of the color set in the Color>Plain C olor of a texture object. I can get the name of a texture or the type of color: getname(GetShaderRecord(TextureHandle,1))that return ''NNA Plain Color'' But Can't find a way to actually find that plain color. Thanks for your help,
  23. I Have very complex pio's. So when I change a parameter in the Object Info palette, it takes a moment (arround a couple of seconds) for the PIO to update. That is very annoying when I need to change a lot a parameter in a row. So I would like to know if it is possible to disable the reseting of the PIO after parameter change. Thanks,
×
×
  • Create New...