Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by VvierA

  1. So everything works fine with my new level dimension tool but I have a severe problem with viewport annotation on sheet layers. My auto level dimension tool gets the dimension by using: GetSymLoc(hParm, x, y); y is displayed as the level dimension. The problem with viewport annotation on sheet layers is, that "GetSymLoc(hParm, x, y);" doesn't get the y-coordinate of the underlying design layer BUT of the sheet layer. So for example if I move my viewport an my sheet layer to rearrange my layout every level dimension will change. Is there any chance to 'access' the coordinate system of the underlying design layer from within a viewport annotation? Any help appreciated VvierA
  2. Thank you very much. It works. Didn't know that this is so easy. VvierA
  3. Hello again, with your kind help I managed to get my plugin working but now there is the next challenge as mentioned in my earlier post: I have a plugin object that may be uses within a layer oder within a viewport annotation. How can I check wether the PIO is inside a layer or inside a viewport annotation and how can I retrieve the scale of the viewport? (the scale of a layer is not so difficult I think) Kind regards VvierA
  4. Thank you all. With your help I succeeded to get it to work. Maybe you could give me another help? I am looking for a way to retrieve the scale of the 'environment' of an PIO no matter if the 'environment' is a layer or viewport? Kind regards VvierA
  5. I tried it but I failed. I couldn't find the command 'SetSymRot' so I tried SetAngle but that didn't work. I was also looking for something like SetSymLoc to move the PIO but I couldn't find something like that. Maybe you have another hint for me? Thank you VvierA
  6. Hi Matt, thank you so much. With your help I think I will make it. First I thought I have to "flip" every command and coordinate inside the PIO once I managed to figure out which way it is orientated. It's a much better idea to unflip the PIO itself. I will keep you up to date. Thanks again, VvierA
  7. Hi there, I try to program a auto level dimension tool and I am using a linear plug-in object to do that. It draws a small triangle with some text showing the y-coordinate of the PIO. The linear plug-in object ist defined (of course) by two mouse clicks. If the first mouse click is more on the left than the second click everything works feine. But: if the second click is more to the left everything becomes flipped so that the text and the small triangle are turned upside down. The angle indicator in the small object info palette shows 180?. That's not intended. I like the POI behave exactly the same no matter if it is drawn from left to right or vise versa. Can anybody help? Maybe I should check if the x-coordinate of the first click is lower than the second? But how could I do that? How could I retrieve the x an y coordinates of the first and the second click of a linear object? Or is there an easier way to prevent the POI from getting flipped over? Thank you for help kind regards VvierA
  8. Solved it with the help of Vectorlab (www.vectorlab.info). I found two subroutines to replace the FSActLayer. The subroutines work in both the construction layer and inside the annotations of a design layer viewport. I admit - I do not understand them completely but that's ok. VvierA FUNCTION H_ActContainer: HANDLE; BEGIN BeginContext; Locus(0, 0); H_ActContainer := GetParent(LNewObj); DelObject(LNewObj); EndContext(0); END; FUNCTION H_FSActContainer: HANDLE; VAR h : HANDLE; BEGIN h := FIn3D(H_ActContainer); WHILE (h <> NIL) & (Selected(h) = FALSE) DO IF Selected(h) THEN H_FSActContainer := h ELSE h := NextObj(h); H_FSActContainer := h; END;
  9. Thank you Josh. I tried to investigate, following your hints but I failed. As I understand I need a replacement for "FSActLayer" because this seems to return NIL if I select something inside a Design Layer viewport. Does anybody know a replacement for FSActLayer that works inside a Design Layer viewport? And does anybody know a routine to check if I'm inside a Design Layer viewport or not so that the script uses either FSActLayer or the 'other' command that works inside the viewport? Kind regards VvierA
  10. Hello everybody, I wrote a small Vectorscript that converts polygons to a custom path object (another plugin I made with the kind help of the members of this forum). The Vectorscript works perfectly with 2012 and it works with 2013 in the construction layer but it fails to work within the 'Annotations' of a sheet layer. Has anybody an idea? Any help or hint is kindly appreciated... ---------------------------------- PROCEDURE allesstempelkonverter; VAR objectH, newobjH :HANDLE; SObjectHandle :DYNARRAY [] OF HANDLE; numsel, zaehl :INTEGER; {in der ersten Schleife werden Handles zu allen gew?hlten Objekten verteilt} BEGIN objectH := FSActLayer; numsel := Count((SEL=TRUE)); ALLOCATE SObjectHandle[1..numsel]; zaehl := 1; WHILE (objectH <> NIL) DO BEGIN SObjectHandle[zaehl] := objectH; zaehl := zaehl+1; objectH := NextSObj(objectH); END; {message (numsel,' Z?hler ',zaehl);} {in der zweiten Schleife werden die Objekte umgewandelt} zaehl := 1; WHILE zaehl <= numsel DO BEGIN IF (GetType(SObjectHandle[zaehl]) = 3) OR {Pr?fung ob es ein Rectangle ist} (GetType(SObjectHandle[zaehl]) = 4) OR {Oval} (GetType(SObjectHandle[zaehl]) = 5) OR {Polygon} (GetType(SObjectHandle[zaehl]) = 6) OR {Bogen bzw. Kreis} (GetType(SObjectHandle[zaehl]) = 21) THEN BEGIN {Polyline} { SetPenFore(SObjectHandle[zaehl],45);} newobjH := CreateCustomObjectPath('db Allesstempel', SObjectHandle[zaehl], nil); END; zaehl := zaehl+1; END; END; run(allesstempelkonverter); ----------------------------------
  11. Thank you very much. Although I made the script earlier (with lots of help from you) I am still a beginner and do not know how to create an event loop or call the ResetObject function. Do you know some sort of sample or reference code so maybe I can adapt it for my purposes? That would be really great. But anyway - thank you very much for your help so far. VvierA
  12. Maybe I found a hint how to solve the problem. It seems to me, that recalculating the PIO makes the room stamp reappear. It's a workaround to invoke the recalculation by editing the polyline of the PIO or editing a parameter. But that's annoying. I checked the options "Recalculate by event, by movement and by rotation" in the PIO options dialog but VW does not recognize the movement of the view area as a movement that invokes the recalculation. Is there a script to force all placed PIOs to recalculate. So I don't have to do it manually?
  13. Hello, I programmed a custom made "space" tool. It's a 2D path object. It's a room stamp and it retrieves the area (and perimeter) of the 2D path and writes it into a database. The space tool then places a room stamp symbol that is linked to the database. The strange thing is: If I use the space tool in the view area of a sheet layer everything is ok first. But if I move the view area on the sheet all the placed room stamps disappear. I can make them reappear by selecting and editing the polyline. Is there a bug in my script or is it a VW problem? Can anybody help? Thank you kind regards VvierA Script (you need a database called "db_raumdaten" and the fields "raumflaeche" and "raumumfang". You also need a symbol that is linked to the database fields and the symbol needs to be selected as a parameter of the PIO) PROCEDURE dballesstempel; CONST kObjXPropSpecialEdit = 3; {das erste Konstantenpaket dient dem 'event enabler' gem. http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=176863#Post176863} kReshapeSpecialEdit = 3; kObjXIs2DSurfaceEligible = 14; kObjXPropEditGroup = 1; kObjXPropEditGroupPath = 2; kObjOnInitXProperties = 5; kResetEventID = 3; feldSTRflaeche = 'raumflaeche'; feldSTRumfang = 'raumumfang'; datenbankSTR = 'db_raumdaten'; VAR theEvent, theButton :LONGINT; status :BOOLEAN; result :BOOLEAN; polyHand, objHand, recHand, wallHand, pathHand, dupeHand, symbHand, layerhandle :HANDLE; objName, symName, flaecheSTR, umfangSTR, par_raumbezeichnung, recordname, pioclass, flaeche_korrigSTR, rundungSTR :STRING; flaeche, umfang, flaeche_korrig, flaeche_korrekt, p1X,p1Y,p2X,p2Y,symbscale, layerscale: REAL; stempelpos :VECTOR; BEGIN vsoGetEventInfo(theEvent, theButton); CASE theEvent OF kObjOnInitXProperties: BEGIN status:=SetObjPropCharVS(kObjXPropSpecialEdit,Chr(kReshapeSpecialEdit)); status:=SetObjPropVS(kObjXIs2DSurfaceEligible,TRUE); status:=SetObjPropCharVS(kObjXPropEditGroup,Chr(kObjXPropEditGroupPath)); status:=vsoInsertAllParams; END; kResetEventID: {Hier beginnt der eigentlich Code f?r das Duplizieren des Polygons und das Einf?gen des Raumstempelsymbols} BEGIN IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN BEGIN pathHand := GetCustomObjectPath(objHand); pioclass := GetClass(objHand); dupeHand := CreateDuplicateObject(pathHand, objHand); SetClass(dupeHand,pioclass); SetPolyClosed(dupeHand, TRUE); stempelpos := GetPtInPoly(dupeHand); {Schwerpunkt des Polygons finden und in Vector speichern} flaeche := ObjAreaN(dupeHand); {Feststellung der Fl?che} flaeche_korrig := ppar_flaeche_korrig; {?bernahme des Korrekturwunschs aus den Parametern} flaeche_korrekt := flaeche+flaeche_korrig; umfang := HPerimN(dupeHand); {Feststellung des Umfangs} flaeche_korrigSTR := Num2Str(2,flaeche_korrig); {Korrekturfl?che wird in String umgewandelt, damit sie in die Datenbank gepatcht werden kann} flaecheSTR := Num2Str(-2,flaeche_korrekt); umfangSTR := Num2Str(2,umfang); {verwandelt Zahl in String - eine Voraussetzung zur Eintragung in die Datenbank} {Message('Fl?che ', flaeche, 'Fl?cheSTR', flaecheSTR);} {Kontrollausgabe der Fl?chen} symName :=ppar_symb; {?bernahme des Symbolnamens aus den Parametern} {symbol(symName, stempelpos.x, stempelpos.y,0);} IF ((pControlPoint01X=0) AND (pControlPoint01Y=0)) THEN {Ein manuelles Setzen der Kontrollpunkte auf 0 soll ein Reset der Position des Raumstempels in die Polygonmitte zur Folge haben} BEGIN {resultstatus := GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand);} symbol(symName, stempelpos.x, stempelpos.y,ppar_dreh); symbHand := LNewObj; {HScale2D(symbHand, pControlPoint01X, pControlPoint01Y, ppar_scale, ppar_scale, TRUE);} recordname := GetName(recHand); SetRField(objHand,recordname,'ControlPoint01X',Num2Str(9,stempelpos.x)); SetRField(objHand,recordname,'ControlPoint01Y',Num2Str(9,stempelpos.y)); {Message('Objekthandle ',objHand,'recordname ',recordname,' Kontrollpunkt ', pControlPoint01X,' ', pControlPoint01Y,' ',stempelpos.x,' ',stempelpos.y);} {Kontrollausgabe der Symbolbreite} END ELSE BEGIN symbol(symName, pControlPoint01X, pControlPoint01Y,ppar_dreh); {symbHand := LNewObj;} {HScale2D(symbHand, pControlPoint01X, pControlPoint01Y, ppar_scale, ppar_scale, TRUE);} {SetSelect(LNewObj);} {Scale(ppar_scale,ppar_scale);} END; symbHand := LNewObj; layerHandle := ActLayer; {Handle f?r aktiven Layer abfragen} layerScale := GetLScale( layerHandle ); {Layer Scale abfragen} SetObjectVariableInt(symbHand,101,2); {Symbol auf symmetrische Skalierung setzen} symbscale := (ppar_scale*layerScale); {Ma?stab des Layers mit manueller Skalierung multiplizieren} SetObjectVariableReal(symbHand,102,symbscale); SetObjectVariableReal(symbHand,103,symbscale); {Message('Objekthandle ',symbHand,'symbscale ',symbscale);} {SetSelect(LNewObj);} {Scale(ppar_scale,ppar_scale);} {ScaleObjectN(symbHand,0,0,1,1);} {Symbol skalieren} {GetBBox(symbHand,p1X,p1Y,p2X,p2Y);} {Bounding Box des Symbols ermitteln} {Message('Koordinaten ', p1X,' ',p1Y,' ',p2X,' ',p2Y)}; {Kontrollausgabe der Symbolbreite} SetRField(symbHand, datenbankStr, feldSTRflaeche, flaecheSTR); SetRField(symbHand, datenbankStr, feldSTRumfang, umfangSTR); SetRField(symbHand, datenbankStr, 'raumnummer', ppar_raumnummer); SetRField(symbHand, datenbankStr, 'raumbezeichnung', ppar_raumbezeichnung); SetRField(symbHand, datenbankStr, 'bodenbelag', ppar_bodenbelag); SetRField(symbHand, datenbankStr, 'ukrd', ppar_ukrd); SetRField(symbHand, datenbankStr, 'ukfd', ppar_ukfd); SetRField(symbHand, datenbankStr, 'okffb', ppar_okffb); SetRField(symbHand, datenbankStr, 'okrfb', ppar_okrfb); SetRField(symbHand, datenbankStr, 'raumkategorie', ppar_raumkategorie); SetRField(symbHand, datenbankStr, 'raum_ehem', ppar_raum_ehem); SetRField(symbHand, datenbankStr, 'neu_bestand_umbau', ppar_modi); SetRField(symbHand, datenbankStr, 'flaeche_korrektur', flaeche_korrigSTR); END; END; END; END; Run(dballesstempel);
  14. Hello, it seems to me, that Vectorworks uses the settings of the "primary unit" for field of a database with type "number" and for example area as unit. Is it possible to change that to the secondary unit? Maybe with a trick or with the help of Vectorscript? Kind regards Vviera
  15. Hello, another little problem. I try to make a custom PIO that displays the y coordinate of the PIO as some kind of custom made level tool. I'd like the text size to be set by the standard setting in the standard 'Text' menue of Vectorworks. So I tried to retrieve the setting with: textsizeR := GetPrefReal(57); But it fails: no matter what text size is selected it shows 48401.111 if I use message(textsizeR); VvierA P.S Even better I would like the text to behave like a dimension text. Showing the unit mark and the number of decimals according to the settings in the general units menue of Vectorworks. Is this possible?
  16. Hello, I'd like to get access via Vectorscript to all standard record information. A path object for example: I can get LineLength which is a standard parameter in the parameter list of the PIO object. But in the object info palette there is also: x coordinate y coordinate z coordinate angle Where do I find this variables? Do I have to use 'GetSymLoc' to get x and y? But how do I get z and the angle? Kind regards VvierA
  17. @Jonathan I tried it and now I know why it's not exactly what I was looking for: The record information can accidently be changed by the user and afterwards it's not easy to find out, if any information has been changed. @Pat Option Nr. 1 is what I'm going for - I think. It looks the most like the solution I was looking for. My favourite was some kind of 'information or notes window' as a standard feature for every symbol. You shouldn't be to see that information as a user of the symbol but not be able to change it without entering some kind of 'edit symbol mode'. Thank you both
  18. Thank you for the information. In the german Fundamentals version (i.e. 'Basic') it's apparently missing. And also I didn't find it in the workspace manager. Maybe I should contact my local distributor. VvierA
  19. Hello, I'd like to attach some notes to a symbol. For example, the date of creation or the creator. I don't want to attach a record because the information should be unchangeable and not assigned individually to each instance but permanently to the symbol. Any hints? Thank you VvierA
  20. Thank you. The hint to export a file as Vectorscript is very promising. Not only in this case. But unfortunately it seems, that my Vectorworks Version (2012 Basic i.e Fundamentals) seems to lack the option to export Vectorscript. Or did I miss it? VvierA
  21. Hello, I'd like to convert lines to walls with Vectorscript. Is there a command for that? Thanks for hints VvierA
  22. I tried this, but it doesn't work. I do not now how to move the newly generated group. Thank you VvierA --- procedure door; VAR ObjectH : HANDLE; BEGIN BEGINGROUP; LINE (0.04,0); ARCBYCENTER (0.04,0,0.805,0,90); MOVE (0.805,0); LINE (0.04,0); ENDGROUP; MOVE3D(2,2,0); END; RUN (door);
  23. Hello, let's say I'd like to make a simple rectangle as a plugin object. I'd use rect(0,0,10,-5) to draw it. The insertion point would be automatically the origin of the plugin object (i.e. 0,0). The question ist: How can I change the insertion point of the plugin object. Let's say, I want the insertion point to be in the center of the rectangle. Do I have to change the command to rect(-5,2.5,5,-2.5) or Is it possible to 'move' the insertion point independently, so that I do not have change the position of the rectangle on the internal coordinate system of the plugin object? The aim in the end is certainly to be able to change the insertion point of the plugin object via the object info palette and to have a code as simple as possible to draw the rectangle. VvierA


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...