Jump to content

VvierA

Member
  • Content Count

    170
  • Joined

  • Last visited

Everything posted by VvierA

  1. @Kevin Thank you very much. Restarting helped although my object is not event enabled afaik. Another strange thing: If I double click the 2d path VW enters the 'edit extrude along path profile' mode. What can I do to start the 'standard 2d reshape mode' for polygons on double click? VvierA
  2. Hello, I try to make a custom 2d path object with Vectorscript. The object has a lot of parameters but the object info palette shows only 7 of them. Is there a limitation of parameters for the object info palette? How can I get over the limitation? or Is there another 'simple' way to allow the user to enter parameters for a path object other than the object info palette? (I do not feel capable to program a custom dialog so it would be great to enter the values via the object info palette.) Thanks for help VvierA
  3. @Miguel Fantastic. That's it. Works perfect. Thank you so much. VvierA
  4. Thank you very much Miguel. In the meantime I examined the script of Example 9 and succeeded to make an alternative solution to generate a 2D path by duplicating the drawn vertex path (see code below). Anyway I am looking now for a way to automatically close the polygon. Do you know a way to 'access' the 'close'-Checkbox via Vectorscript? VvierA PROCEDURE 2dpath; VAR theEvent, theButton :LONGINT; result :BOOLEAN; objHand, recHand, wallHand, pathHand, dupeHand :HANDLE; objName :STRING; BEGIN IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN BEGIN pathHand := GetCustomObjectPath(objHand); dupeHand := CreateDuplicateObject(pathHand, objHand); END; END; Run(2dpath);
  5. Thank you Miguel. If I understand you correctly I have to insert code that draws the lines. And I get the coordinates to draw the lines from the data that is returned by the vertex code. What confused me was an example I found at vectorlab (Example Nr. 9) http://www.vectorlab.info/index.php?title=Events#Example_9 It's actually an example to explain Object events but it uses the 2D Path object and so I tried it. There is lots of object event code inside but strangely I can not find any code for drawing lines or polygons in this script. So how does it work? Thanks again VvierA P.S. Strange enough the example does not work like it should. It should go 'into 2D Reshape mode on double click' but if I double click an instance of that object it goes into the 'edit path object profile' mode.
  6. Hello, I am a beginner and to start with vectorscript I'd like to make a simple 2D path object. It should work like the standard Vectorworks polygon tool but the polygon should close automatically after creation. I succeeded to generate a new 'empty' 2d path object with no code yet and to integrate this new tool in my workspace. Although there is no code yet, I can draw a 2D polygon shape. The problem is: the shape is invisible. It shows no lines and no filling. I can select it by 'select all' and it is shown in the info palette but it is not possible to change the appearance to make it visible. Question: What code do I have to add to make the path visible respectively to make this 'generic' 2d path behave like the original 2d polygon tool? Kind regards VvierA
  7. Hello, I am a beginner and to start with vectorscript I'd like to make a simple 2D path object. It should work like the standard Vectorworks polygon tool but the polygon should close automatically after creation. I succeeded to generate a new 'empty' 2d path object with no code yet and to integrate this new tool in my workspace. Although there is no code yet, I can draw a 2D polygon shape. The problem is: the shape is invisible. It shows no lines and no filling. I can select it by 'select all' and it is shown in the info palette but it is not possible to change the appearance to make it visible. Question: What code do I have to add to make the path visible respectively to make this 'generic' 2d path behave like the original 2d polygon tool? Kind regards VvierA
  8. Ok thank you very much. I'll try that. VvierA
  9. Hello, I am registered user of the german version of Vectorworks 'Fundamentals', called Vectorworks 'Basic'. There is a menu command called 'Klassen...' in the context menu (right click). I tried to call this menu via DoMenuTextByName('Klassen...', 0); but Vectorwords does not recognize the Menu. 'Error: KLASSENTOOL DOMENUTEXTBYNAME - Menu cannot be found. Klassen...' Does anybody know if there is a limitation to the procedure to certain menu commands and is there another way to call the Menu? Best regards VvierA
  10. Hello there, another simple question for a beginner like me: I generated a polyline with VS. Closepoly; Beginpoly; AddPoint(0,-(PBOXWIDTH/2)); AddPoint(pLINELENGTH,-(PBOXWIDTH/2)); AddPoint(pLINELENGTH,(pBOXWIDTH/2)-(gefprozentv*pLINELENGTH)); AddPoint(0,(PBOXWIDTH/2)); Endpoly; Now I want to change the visibility of the line segments with SetVertexVisibility. But I need a handle to the previously generated polyline. How do I get it? Thank you for help VvierA
  11. Hello Josh, thank you very much so far. Finally I got it. I read some warning about the complexity of event management in Vectorscript and decided to try the other method with the hidden parameter to compare the values. It works great. The setting of the parameter also works now even though I do not know what the problem was. Maybe the restart of VW helped. The debugger is also very helpful.
  12. Hello there, I am using the Basic (i.e. Fundamentals) version of Vectorworks. It lacks the 'normal' Export PDF Menu Item but has a simplified version of it called 'Export PDF (Quartz only)' on the mac version. I want to use this menu item in a Vectorscript but cannot find a way to call it. There is no direct function of it nor is it listet in 'DoMenuTextByName Constants' Is there another way to use it in Vectorscript? Why is it missing? Thanks for help VvierA
  13. Do I get the handle on setting the parameter fields via: resultstatus:=GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand); Or do I have to make it sure in another way? Regarding the 'vsoStateGetParamChng' I am currently studying the Vectorscript References with all event and parameter related information. Not so easy - but maybe I get it. Some sample script might help if somebody knows one. VvierA
  14. My aim is to build something that is similar to the x/y coordinates vs. angle length mode in the object info palette for a line. I want to have the option to enter the tilt of my PIO via angle or tilt in percentage. And I want the object info palette to recalculate the other field when I define one field. In order to do that I defined a variable to transfer the value of the parameter to it. Than I wanted to do the recalculations and write the result back to the other parameter hoping that the value of the parameter in the object info palette will be refreshed. Maybe that concept doesn't work? Do I have to switch between the two methods to enter the tilt of my object by changing the visibility of the parameters? I will try the debugger but I do not know yet if this helps me to finish my script successfully. Maybe you know another example of an PIO where one parameter is calculated by another referring to each other? Unfortunately it is not possible to study the built in tools like the 'Draw a Line' tool where one could study the correlation between the x/y fields and the angle/length mode. That's exactly what I am aiming for.
  15. Thank you all. I found my mistake. I copied the string from the PDF Vectorscript Language Guide and the single quotes were not copied correctly. The difference was hardly visible. Now the function makes no error message but there is another problem: I cannot set the parameter to the new value. The name of the Parameter is GEFPROZENT and the name of the variable (real) is also gefprozent. I use the message function to get feedback and see what the values are. In my example the variable gefprozent is '1', the Num2StrF of gefprozent is also '1' but PGEFPROZENT remains '0'. What is my mistake? Code: resultstatus:=GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand); recordname:=GetName(recordHand); gefaelle:=PGEFGRAD; gefprozent:=tan(deg2rad(gefaelle)); SetRField(objectHand,recordname,'GEFPROZENT',Num2StrF(gefprozent)); message (gefprozent,' ',Num2StrF(gefprozent), ' ',PGEFPROZENT);
  16. The two lines producing the error message are: resultstatus:=GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand); SetRField(objectHand,GetName(recordHand),?Space Width?,'Test'); What I was wondering is: The SetRField function needs a handle and some strings. Maybe the handle 'objectHand' is not successfully retrieved by the line above the SetRField command?
  17. @maarten Thank you for your help. It seems to be that I was on the right way. Unfortunately the error message is still there and I cannot find the typo I might have in my script. Another question concerning your example: What do I need the bool variable for? Or is it just used to get the handles for the setrfield function? Q4: I was looking for a example for a PIO where a parameter can be given in two or more ways. For example a PIO where you can set the tilt via delta y, or angle or as percentage. @ Miguel Thank you also. That sounds interesting. Can you give some links to information about 'event enabled method' and custom made parameter changes? VvierA
  18. Hello there, I'm trying to script a rectangular plugin with some parameters concerning the tilt of a line. The parameters should refer to each other like that: When you enter the angle as a parameter for the tilt in the palette, the parameter for the tilt in percentage should be calculated and vice versa. And want to this just like the reference between polar-angle and classical x/y coordinates mode. No matter which values you enter - the other parameter will be calculated. My idea is, to do that with GetCustomObjectInfo(objName,objHd,recHd,wallHd); and SetRField(objHd,GetName(recHd),?Tilt?, Num2StrF(tilt)); The problem is, that Vectorworks stops with the errors: Line #17: SetRField(objHd,GetName(recHd),?Tilt?, Num2StrF(tilt)); | { Error: Expected a new factor here. } | { Error: Expected a string. } | { Error: Expected , } | { Error: Expected a new factor here. } | { Error: Expected a DYNARRAY of CHARs. } | { Error: Expected ) } | { Error: Did not expect this after end of statement - missing ;? } ________________________________________ Can anybody help? Q1: Is this the correct method to build a plugin with Parameters refering to each other? Q2: If it's the right method - what's the cause for the error message? Q3: Am I right, that it is not possible to call the function 'GetCustomObjectInfo' directly? I have to use it like a handle for example: status:=GetCustomObjectInfo...; And with defining the status handle by that, all the other information will be retrieved an be usable for the SetRField procedure. Q4: Are there any examples or open source plugins where I can study the correlation between two parameters in a rectangle object. Thank you very much, 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...