Jump to content

_c_

Member
  • Posts

    2,434
  • Joined

  • Last visited

Everything posted by _c_

  1. Is VS support for VP class overrides planned? Orso
  2. Hi Petri, this below was my own experimenting field with the matter. I'm sure it can help others too. I didn't check it since a while, so I hope it doesn't have too many problems. make 3 plugins as follows: 1 object 1 command 1 tool All identical, with two parameters of type text: my name, text field, then run this by include: { ************************************************ Orso B. Schmid - Do not copy it if you don't mean to share it! ************************************************ If an object is selected, the tool will search for eventual records in FSActLayer and display infos about them. If nothing is selected, or the selection doesn't contain any record, the tool will display infos about himself. If capslock key is activated while launching the plug-ins, it will deliver the currently available record definitions (document-instances versus object-instances) if capslock is on and command key is pressed while launching one of the plug-ins, the whole name list is parsed for eventual hidden records. ************************************************ This little utility allows analizing Plug-In-generated records (VSM, VST, PIO) as well as 'normal' records, up to hidden records, if any given. I hope it can be of use to others. Some of the infos displayed are quite absurd and pedantic. The Handle numbers, just to mention one... instructive to look at, though, expecially as to where they change and where they don't. This script must ideally be included in three plug-ins identical in parameters and script content but different in type (a command, a tool, a PIO) in order to fully display the nuances between them. All three plugins must have 2 parameters of type text: my name, text field, The script is kept as simple as it was in my power to do. I privileged declaring redoundant variables instead of nesting routine calls, in order to have the meaning of each easier to comprehend. P.S. There are special objects who, even if they're not attachd to a type 86, create records that do not display on resource browser. They are only accessable parsing the name list: VW 11.5, 12 Viewports (type 122): creates a record 'NNAcartoon', some sort of attribute-child of 57, normal record (only one name) VW 12 Walls (type 68): creates a record '_NNA_Wall_Style_Format', some sort of attribute-child of 57, normal record (only one name). } PROCEDURE RecordExplorer; CONST cBR = chr(13); { ascii char 13 } VAR gRecordInfo : DYNARRAY OF CHAR; gIsOK, gPIOrunMe, gIsMe : BOOLEAN; objName, gVSobjName : STRING; gVSobjH, gVSobjRecH, gObjH, recH : HANDLE; gRecCnt, gRecIndx : INTEGER; P : POINT; Modus : STRING; temp_b : BOOLEAN; temp_s : STRING; temp_h : HANDLE; temp_i : INTEGER; temp_Li : LONGINT; { returns a string with all object's relatives } FUNCTION familyQuest(aH: HANDLE): STRING; BEGIN temp_s := ''; WHILE getType(aH) <> 0 DO BEGIN aH := getParent(aH); temp_s := concat(temp_s, chr(58), getType(aH)); END; familyQuest := temp_s; END; { collects info about a record } PROCEDURE recInfo(recHdl: HANDLE); TYPE PI_record = STRUCTURE { Plug-In record info } univName : STRING; locName : STRING; recDefH : HANDLE; { record definition, type 47 } recH : HANDLE; { record attribute, type 48 } fieldCnt : INTEGER; END; PI_Field = STRUCTURE { Plug-In field info } univName : STRING; locName : STRING; refName : STRING; appVal : STRING; docVal : STRING; objVal : STRING; tryVal : STRING; END; VAR PI_rec : PI_record; PI_fld : DYNARRAY[] OF PI_field; i : INTEGER; { replace a string } FUNCTION searchReplace(sourceStr, searchStr, replStr: DYNARRAY OF CHAR): STRING; VAR theSourceStr : DYNARRAY OF CHAR; temp_Pos : INTEGER; BEGIN theSourceStr := sourceStr; temp_Pos := pos(searchStr, theSourceStr); WHILE temp_Pos > 0 DO BEGIN Delete(theSourceStr, temp_Pos, len(searchStr)); Insert(replStr, theSourceStr, temp_Pos); temp_Pos := pos(searchStr, theSourceStr); END; searchReplace := theSourceStr; END; BEGIN PI_rec.recH := recHdl; PI_rec.univName := getName(PI_rec.recH); PI_rec.recDefH := getObject(PI_rec.univName); { my thanks to Patrick McConnel, from www.VectorDepot.com } { if you're interested, check his 'Set PIO Defaults.vsm' } temp_b := GetLocalizedPluginName(PI_rec.univName, PI_rec.locName); { the mother of all sources for understanding plug-ins records is NNA exaple found under 'GetLocalizedPluginName', in the official VS Function List Guide, thank you NNA... } PI_rec.fieldCnt := numFields(PI_rec.recH); gRecordInfo := concat(gRecordInfo, '***************', PI_rec.univName, '***************', cBR, 'My Record Def. Handle nr.: ',concat(PI_rec.recH), cBR, 'My Record Handle nr.: ', concat(PI_rec.recDefH), cBR, cBR, 'My Universal Name: ', PI_rec.univName, cBR, 'My Localized Name: ', PI_rec.locName, cBR, 'My Record Def. index: ', name2index(PI_rec.univName), cBR, 'My Record index in object: ', concat(gRecIndx), cBR, 'My Record fields count: ', concat(PI_rec.fieldCnt), cBR, cBR); { this wanted to be an ugly way to retrive the application value } { it doesn't work } locus(p.x, p.y); setRecord(LNewObj, PI_rec.univName); Allocate PI_fld[1..1]; { resize array } IF PI_rec.fieldCnt > 0 THEN BEGIN Allocate PI_fld[1..PI_rec.fieldCnt]; { field infos } FOR i := 1 TO PI_rec.fieldCnt DO BEGIN PI_fld.univName := GetFldName(PI_rec.recH, i); temp_b := GetLocalizedPluginParameter(PI_rec.univName, PI_fld.univName, PI_fld.locName); { this has different results according to who is 'PI_rec.recH':} { if 'PI_rec.recH' is a HANDLE to a VS object record: } { replace space ' ' with underscore '_'} PI_fld.refName := concat('P', searchReplace(PI_fld.univName, chr(32), chr(95))); { UprString(PI_fld.refName ); } { this seems to break the routine } PI_fld.appVal := GetRField(PI_rec.recH, PI_rec.univName, PI_fld.univName); PI_fld.docVal := GetRField(PI_rec.recDefH, PI_rec.univName, PI_fld.univName); PI_fld.objVal := GetRField(gObjH, PI_rec.univName, PI_fld.univName); { it is equal to: := GetRField(H, PI_rec.univName, 'my name'); } { := PMY_NAME; a reference to a parameter 'my name' } { := PMY_TEST_FIELD;a reference to a parameter 'my test field' } { the last 2 has only a meaning if the field belong to some plug-in parameter } { if you miss the correct field name orthography, an empty value is returned, no error } { *****************************************************************?} { ****************** PLACEHOLDER FOR EXPERIMENTS ****************** } { temp_h := getParent(getObject('NNAcartoon')); } { PI_fld.tryVal := GetRField(temp_h, getName(temp_h), GetFldName(temp_h, 7)); } { 1 int: 7 2 int: 1 3 int: 1 4 int: 0 5 int: 0 6 int: 0 7 real: 1 } { temp_h := getObject('*DEFAULTS*'); PI_fld.tryVal := GetRField(temp_h, getName(temp_h), GetFldName(temp_h, 1)); } gRecordInfo := concat(gRecordInfo, 'Field Index: ', i, cBR, 'Field Type: ', GetFldType(PI_rec.recH, i), cBR, 'Universal Name: ', PI_fld.univName, cBR, 'Localized Name: ', PI_fld.locName, cBR, 'Reference Name: ', PI_fld.refName, cBR, 'Application value: ', PI_fld.appVal, cBR, 'Document value: ', PI_fld.docVal, cBR, 'Object value: ', PI_fld.objVal, cBR, cBR); END; END; END; { of recInfo } BEGIN { ***** remember that this script should be runned by INCLUDE from 3 plug-ins: a command, a tool, a PIO ***** } { all with identical parameters and two rows of script: $INCLUDE Data\Example Record Explorer.vss the second row is empty, just to avoid VS-related problems in loading the include } { this will return false if the tool or the command are running this script } gPIOrunMe := GetCustomObjectInfo(gVSobjName, gVSobjH, gVSobjRecH, temp_h); { wall handle unused } gIsOK := gPIOrunMe; gIsMe := TRUE; { gIsMe is true if the obj analyzed is either tool, command or PIO } { not a PIO, is command or menu } IF NOT gPIOrunMe THEN gIsOK := GetPluginInfo(gVSobjName, gVSobjRecH); { since is tool or command, the handle to them is not a 'drawable' obj?} {?the following routine get holds of an obj type 47: a record definition } {?that is: the handle to a tool or command corresponds to a handle to a document data-object } IF gIsOK THEN BEGIN Modus := 'Is me! Tool or Command script object'; { is script object, info about themselves } IF gPIOrunMe THEN BEGIN Modus := 'Is me! PIO script object'; gObjH := gVSobjH; { is PIO } END ELSE gObjH := gVSobjRecH; { is command or tool, its obj = its record } { is an object on drawing with one or more attached records } IF (FSActLayer <> NIL) AND (numRecords(FSActLayer) > 0) THEN BEGIN Modus := 'FSActLayer with records'; gIsMe := FALSE; gObjH := FSActLayer; objName := getName(gObjH); END; { we are using the point for the locus and for create text } P.x := 0; P.y := 0; { I seem to need this here for making modifier keys work } { Objects care themself for user insertion point } IF NOT gPIOrunMe THEN GetPt(P.x,P.y); { is object document, type 0, NIL } IF capsLock THEN BEGIN Modus := 'capsLock: document'; gIsMe := FALSE; gObjH := NIL; objName := '<record definitions children of container 57>'; IF command THEN BEGIN Modus := 'capsLock and command: document + hidden'; gObjH := NIL; objName := '<all record definitions (also hidden)>'; END; END; gRecCnt := numRecords(gObjH); gRecordInfo := concat( 'Modus: ', Modus, cBR, cBR, 'RECORD INFO', cBR, cBR, 'Script runned from: ', gVSobjName, cBR, 'Object analyzed (name if any): ', objName, cBR, 'Object type: ', getType(gObjH), cBR, 'Object parents ', familyQuest(gObjH), cBR, 'Object Handle nr.: ', concat(gObjH), cBR, cBR, 'Record Count: ', gRecCnt, cBR, cBR); IF gIsMe AND (NOT gPIOrunMe) THEN { tools and command don't have an obj on drawing, pass a handle to their record } recInfo(gVSobjRecH) ELSE IF capsLock AND command THEN BEGIN alrtDialog('caps and command'); FOR temp_Li := 1 TO NameNum DO BEGIN recH := getObject(NameList(temp_Li)); IF getType(recH) = 47 THEN recInfo(recH); END; END ELSE FOR gRecIndx := 1 TO gRecCnt DO BEGIN alrtDialog(concat(gRecIndx)); recH := getRecord(gObjH, gRecIndx); recInfo(recH); END; textOrigin(P.x,P.y); createText(gRecordInfo); { createText accepts dynarray of chars, thus no 255 chars limit } { resetObject(gVSobjH); } { actually is not ok: message would be 'false'} END ELSE message(gIsOK); END; Run(RecordExplorer);
  3. Hallo dcont, sorry for the delay. It doesn't work for you? This is surprising. It works well for me under Mac. My VW dealer confirms that it works under Win Architect. VSD, does it work for you? The template folder is anyway created by the user if it is missing, so you shouldn't have limits there. The whole network usage is anyway horribly tricky as to the rest of the "special" folders. For example the complete set of Defaults. Defaults are fantastic and should be used at any cost. In order to be able to share default resources you cannot use aliases, both for folders as for the included files, but you can do as follows: -- Open a local default file (local app folder for each user on the network) -- Create in the file a workgroup reference to a file on the server containing the resources that you like to share. Set it on A, reload automatically on. Now the resources are shared. You can maintain them in the file on the server, but the user must open the file in order to upgrade it. Which is better than doing a manual copy of the files. Every user should update the resources, you have no access to resource folders outside your own app folder and cannot coerce them to new values. But you can script a simple 'Open file...' wich upgrades the file according to the workgroup reference automatically. The users on the network should run it on your request. Most resources can be anyway easily accessed by Resource Browser, if one knows how to search, but for the classes. The classes are not to be accessed from the resource browser, only as standards, moreover they do not restore to the standard values if their name is already in the name list of the doc. Solution: workgroup reference to a standard with "Update class definitions" checked. Or a proper VectorScript. Also, horrible, scary, VP class overrides are tremendous to change from one doc to the other. The pipette transfers class visibilities from one doc to the other but not the overrides (TRUE under VW Fundamentals, perhaps a bug). And you cannot copy a viewport from one doc to the other. As to myself, I didn't yet find the way to access Class overrides in ViewPorts with VectorScript. Didn't look that hard either, might be a question of parent that I didn't exploit properly. So as to VW Fundamentals there is no way to transfer class overrides across documents. Even less can you create a network standard for the overrides, this should also apply for VW architect. You can only create a template. New file from template, copy/reference the layers from the original file, load in the template VP with proper class overrides on, delete original file..... Awful. I think VW is moving towards network facilities, but we are not quite there. It doesn't work without special plugins/scripts. It should be standard. VW 12.5 is a fantastic product, fancy, fast, (a bit buggy still, but let's wait for VW 12.5.1 ) perhaps we'll see soon important improvements as to the network as well. Orso
  4. To organize common resources for a network proceed as follows: - move a resource folder from a local application folder to the location of your choice on a server - create a shortcut/alias of this moved folder back to the local application folder From that point on you'll be able to share the resources contained in the folder even if they reside on an external partition/drive. Please note that you MUST use original folders created by VW, and THEN link them back to the local application folders. If the folder was not created by VW it doesn't work. The files contained in the folder are not recognized. I personally do not understand how come it has to be a folder created by VW, why it is not possible to simple create a folder and name it according to the usual resource standards. This is particularly uncomprehensible for me under Windows, who do not emploies ID for the creation of aliases/shortcuts. But this is not the place to explore this kind of things. I must thank my local distributor for this hint, who found the solution and kindly helped me out. Orso
  5. The question was already answered in another thread: what did I do wrong with the updater. Install the update found by Aladdin's http://www.aladdin.com/support/hasp/hasp4/enduser.asp
  6. It seems that the dongle hasp driver doesn't correctly update or install (completely missing). Is it possible to download the proper actual driver somewhere?
  7. Raymond, thank you, that's a long-wished-for introduction to vectors. I don't know if I ever read a clearer one. Lands straight into my code snippets collection. To dwell together with many other RMullin code-snippet-friends! Orso!
  8. OK, I'll try that. But I doubt it will be better. The whole system is a clean install, from the Apple CD (even if CUPS could be higher than 1.1 by now). I know VW doesn't install any PPDs, I was just wondering which ones it's reading. As a principle it is no VW issue. It just happens to get some buggy ones. Thank you. Orso
  9. I might be wrong, but I believe there's some issue with VW and PPD files. I cannot at the moment study the whole theme of cups printing, so my hypothese might well be wrong. I'm trying to print to a Konica Minolta Di2510f, no driver, PC world only. This printer is a laser, based on PCL-6 with paper size support up to A3. After much experimenting, I found out that the driver HP LaserJet 6 series CUPS 1.1 worked very well and was supporting the format A3. This was valid under MacOs X.2. Recently I upgraded the system to X.4.6: the above mentioned CUPS driver works now still well under the German system but not under the english one: no A3, bad dithering. This is obviously not a VectorWorks problem. The VectorWorks problem, I think, is that VW seems to be taking the PPDs from the en PPD folder. The buggy one. Even if the system language currently installed is different. Is VectorWorks 11.5 Fundamentals EN dongle loading PPD files always from the English system? Unregarded of currently valid system language? I experimented with other applications. VW seems to be the only program loading the english PPDs. I'm currently unable to print decently, I'm bound to export to PDF in order to get some other app to do the printing job from the german driver. Can someone help? Orso
  10. (to R. Anderson) I'm almost shaking telling YOU this, but, yes, it can be done. I have done the script.
  11. (to Katie) You're replying to me or am I wrong? If you are, yes, I don't see any need for doing nothing else, but open the file and edit it. It functions brillantly for me. Absolutely no need for weird tricks.
  12. You could achieve this through a simple -even if not obvious- VectorScript. If I might make an observation, this is not the way VW is meant to function. Make the best out of what VW has to offer you, which is not little, and use it at it's full potential, which is enormous. You'll soon be glad to be off Acad.
  13. Interesting question. If this might help you, a simple 3D object on drawing, like an extrude, is a 2D with a special data-attribute d33 attached. After manipulation they might have a more complex structure, owning also user data-attribute. Some kind of manypulations (tapered extrudes, for example) simply turns the object into a nest of many others, included hidden types 86 (PIO instance), Do you think you can succeed with cocoa? Passing thru VS or skipping that? If you pass thru VS is quite easy to draw anything you wish. Rather tricky is to parse the sys clipboard, being that dependent from the app that generated it. If we are speaking of the same clipboard like here (and here is the very VW clipboard, readen from outside VW): -- select a whatever obj on drawing return (the clipboard as record) --> PICT, Quickdraw Picture I'm very interested on the format too, if you ever get to understand this. To my knowledge, VW builds some sort of unbreakable session for every frontmost doc. This session is crazingly unique: it keeps on beeing valid even if other apps are frontmost and running: try opening a VW doc, then some other app, such in a way, that you can glimpse to the VW doc window laying below. Toggle the ctrl key while you're sure to be in the other app, active and running. You'll notice that the VW menu still responds to the key. While VW is not active. I don't know of any other app behaving this way, but I'm not very fit in this sort of things either. I'm no programmer, just a scripter with a passion for -among others- AS. How can you enter the frontmost doc session with cocoa? If you can explain me that, I'll be very glad. Orso
  14. I'd love to know what people thinks of Microstation, expecially switchers from Microstation to VectorWorks and the other way around. Extensive search on the internet brought truly miserable results.
  15. It's inches to metres conversion? So it did depend on units? It could have been on the Function Reference Book: AddVectorFillLayer needs INCHES! And me fearing some use of the Lorentz/Einstein constant (0,3937?!!!!) which takes into account time?if I got it right.
  16. Actually it doesn't really matter what for a hatch definition one picks. The point is that there's some sort of scaling (exactly: 3,937007874015748) of whatever lenght value. Try this schematic hatch definition: hatchName1 := 'A New Hatch'; BeginVectorFillN (hatchName1, FALSE, FALSE, 0); AddVectorFillLayer (0, 0, 1, 1, 1, 0, 1, 1, 255); EndVectorFill ; It's a simple diagonal hatch with: start: 0, 0 repeat: 1, 1 offset: 1, 0 If you think of it as a triangle, one expects to have an rect-triangle with base 1 (metres or inches, doesn't matter) According to pitagora its diagonal should be 1,41421. But what the newly defined hatche really draw is something else: start: 0, 0 repeat: 0.254, 0.254 offset: 0.254, 0 As I said, there's a scaling factor from the script to the drawed thing. Why? Does someone recognize the factor 3,937007874015748? Is it some constant value like pi, or whatever that I'm to ignorant to recognize? I'm really math-idiot. Simply don't get it. Units, page or world settings, layer scale, all seems to have no infuence on it.
  17. I wonder if someone is reading this, still: look what it looks like the typical 'Default Hatch' shipped with every VW file: hatchName1:= 'Default Hatch'; BeginVectorFillN(hatchName1,TRUE,FALSE,0); AddVectorFillLayer(0,0,1.968503937,1.968503937,0.196850394,-0.196850394,1,1,255); EndVectorFill; Now the point is: these weird numbers, where do they come from? The hatch actually had a simple values, like 0,07 plus-minus appropriate angles- so how?
  18. Does anybody know how to add real buttons on plugins obj info panel? I don't mean boolean parameter buttons. For instance: walls objects display a "cavities" button which triggers a dialog. How do I achieve such a thing? Which reminds me: does anybody have a couple of good examples for keeping track of user events? I haven't been scripting VW since 8.5 and I struggle to get examples for the new functions.
  19. It is because sheets shows the margins, that I hoped to be able to retrive their values through VectorScript. I actually don't - for the moment- need to SET them, only to GET them, in order to do some proper layout calculations in a PIO. MacOs X VW 11.5 Foundation, as long as it still has something left in it
  20. Does someone know a way to get the boundary box of the real paper size? That is: GetDrawingSizeRect + the active printer margins, according to what is set in 'Page setup'. I really cannot figure out how?
×
×
  • Create New...