Jump to content

maarten.

Member
  • Posts

    387
  • Joined

  • Last visited

Everything posted by maarten.

  1. Bedankt . Drawing a dashed line in 3D isn't really the problem, I just need to know the length of the pairs of the dash style. And as far as I know, that's not possible with the repetitive unit tool, or am I mistaken?
  2. Oke, that's very odd... Have you tried installing VW again? It's quite strange that it works here on several computers (PC and mac) on several versions (2008-2010). Do you have the latest SP? Does it work with the scripts i posted above? I can't think of anything else, it should work normally, very strange.
  3. There's some helpfull information about this in "What VectorScript Can't Do" in the "VS Language Guide".
  4. I need to have a dashed line in 3D, so by drawing each part of the dash as a 3D poly that becomes possible. But at the moment, the user can choose its own dash style in my tool and therefore i need to know the length of the pairs so i can redraw it as seperate 3D polys. But i'm afraid it isn't possible, i saw yesterday that this has also been asked in the mailinglist without an answer... To bad. If anybody has an idea, you're free to let me know . Does anybody know if this is possible in C++? And thanks for the answer WhoCanDo .
  5. I can understand this completly and you are correct, a tool needs to work properly. But again, i think i don't understand you completly. When you draw a line (for example) in VW, you can't snap to your first point either, same when you draw a polygon. By using the shift button however you can force the line to be drawn under a fixed angle. That's the way VW works and is (in my opinion ofcourse ) not such a bad way. So if i understand you correctly, you want to adjust this standard behavior so that the user don't need to use their shift button to draw lines under a fixed angle? You can change the position of the points lateron ofcourse by recalculation, or maybe if you adjust some snap options, you can also get the behavior that you want but i haven't tried it before. Strange, works fine here... With snapping point, do you mean the snap options? if so, you can adjust them with: Snap to Grid: SetPref(37,TRUE); Snap to Object: SetPref(38,TRUE); Snap to Edge Points: SetPref(48,TRUE); Snap to Edge Points: SetPref(48,TRUE); Snap Radius: SetPrefInt(54,90);
  6. Hi all, With SetDashStyleN('My Dash Style', True,num,pair1DX,pair1DY,pair2DX,pair2DY,pair3DX,...); you can create a dash style. But I need it the other way around, I need to know how long pair1DX,pair1DY,pair2DX,pair2DY,pair3DX,... is of an existing dash style. Anybody an idea how this is possible with VS? Tia
  7. Nope, you're right, here neither (VW2010 on Windows). Maybe i'm missing something, but why don't you use the shift button to draw with vert and hor snapping? If you would draw a locus on the first point, you could snap to it and afterwards delete it like the rest of the lines... Not really the most beautiful solution, but it might work.
  8. Thanks Chris, that was the info i needed .
  9. Could you test this one and see if it works for you? It works for me (VW2008 on mac). Create a Tool with this code: PROCEDURE Tool; VAR cnt : INTEGER; x,y : ARRAY[1..6] of REAL; hL : ARRAY[1..5] of HANDLE; h : HANDLE; BEGIN GetPt(x[1],y[1]); FOR cnt:=2 TO 6 DO BEGIN GetPtL(x[cnt-1],y[cnt-1],x[cnt],y[cnt]); MoveTo(x[cnt-1],y[cnt-1]); LineTo(x[cnt],y[cnt]); hL[cnt-1]:=LNewObj; ReDraw; END; FOR cnt:=1 TO 5 DO DelObject(hL[cnt]); BeginPoly; FOR cnt:=1 TO 6 DO AddPoint(x[cnt],y[cnt]); EndPoly; h:=CreateCustomObjectPath('2dpath',LNewObj,NIL); END; RUN(Tool); And create a 2d Path Pio with the name '2dpath' and this code: PROCEDURE Test; VAR objHand, recHand, wallHand, pathHand, duplHand?:HANDLE; objName?:STRING; BEGIN IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN BEGIN pathHand?:= GetCustomObjectPath(objHand); duplHand?:= CreateDuplicateObject(pathHand, objHand); END; END; Run(Test);
  10. Do you want that the 2D path gets drawn immediately when the user gets to the maximum clicks and then can't click anymore, or do you want that the user can click as long as he wants and that after he ends it (by double clicking), the path only draws the maximum of points? The second option isn't so hard, just save all the points into an array and when you start drawing, just ignore the points that gets above the maximum For Integer:=1 TO Maximum DO DrawObject; For the second one, i think that the easiest way is to make 2 plug ins. One 2D Path pio and one tool. In the tool you use something like: FOR cnt:=1 TO maximum DO GetPt(x[cnt],y[cnt]); BeginPoly; FOR cnt:=1 TO maximum DO AddPoint(x[cnt],y[cnt]); EndPoly; h:=CreateCustomObjectPath('name of 2D Path pio',LNewObj,NIL); EDIT: didn't test it, but i think it should work.
  11. I need some help from all you Native English speakers. How do you call it when a Wall Component goes around the corner at the Wall Opening? For example: you have a brick wall (the green one in the image) and at the Wall Opening, the bricks will go around the corner, they got rotated 90?. In Dutch it's called "Steense Slag" or "Diepe Negge", but i can't find the correct Englich translation. Anybody an idea?
  12. Indeed, thanks for the info. Although the above should also work, you can fix it by assigning every part of your defined type of Var to that Var, I had to do this in one of my scripts to solve it: instMyType.f1 := procarrMyType[ind].f1; instMyType.f2 := procarrMyType[ind].f2;
  13. You can make a menucommando that will run your script and at the ending call the rpint dialog: PROCEDURE BlaBla; BEGIN {your code} DoMenuTextByName('Print',0); END; RUN(BlaBla); I gues you can do the same when you open a file (not tested): PROCEDURE BlaBla; BEGIN DoMenuTextByName('Open',0); {your code} END; RUN(BlaBla); As far as i know it's not possible to automatically run a script at the begin or end of the program.
  14. Had it ones but it disappeared without leaving a clue... What happens if you run a document script with just "Redraw" in it? If the pios would show again, you could use a Redraw at the end of your script?
  15. Same thing happens quite often here. Go to the VW folder in your libary and open the Error Output text file. Delete all the content and save it. Compile again and you'll get te correct error (or no error). (you can also just delete the file for it be created again by VW)
  16. maarten.

    getbbox

    You're mixing your x and y values. It should be GetBBox(hline,x1,y1,x2,y2); So first the x and y value of the left upper point, then the x and y value of the right under point.
  17. Not sure if it's this what you need, but if you use this script, the next (and all folowing) objects will be drawn "by class". I use it quiete a lot because i got many external drawings that where the standard attributes aren't "by class". [font:Courier New]LSByClass; PenColorByClass; LWByClass; FPatByClass; FillColorByClass; OpacityByClass;[/font]
  18. Here's a version that should work: PROCEDURE Example; VAR x,y : REAL; keyhit : INTEGER; h : HANDLE; InMu : HANDLE; BB1,BB2 : POINT; WallRot : REAL; SymRot : REAL; SymFlip : BOOLEAN; SymAngle : REAL; BEGIN keyhit:=27; WHILE NOT keydown(keyhit) DO BEGIN GetPt(x,y); h:=PickObject(x,y); IF h<>NIL THEN BEGIN {look if the chosen object is a wall} IF (GetType(h)=68) THEN BEGIN {get the rotation of the wall} WallRot:=HAngle(h); {get the handle of the first object in that wall} InMu:=FIn3D(h); IF InMu<>NIL THEN BEGIN REPEAT {If the object is a Symbol or a pio, then...} IF (GetType(InMu)=86) OR (GetType(InMu)=15) THEN BEGIN {...take the bounding box of that object} GetBBox(InMu,BB1.x,BB1.y,BB2.x,BB2.y); {if the mouseclick is located in that BBox, then that's the object we need} IF (PtInRect(x,y,BB1.x,BB1.y,BB2.x,BB2.y)) THEN h:=InMu; END; InMu:=NextObj(InMu); UNTIL(InMu=NIL); END; {Get the rotation and flip of the symbol/pio} SymRot:=GetSymRot(h); SymFlip:=IsObjectFlipped(h); {calculate the angle} IF WallRot<0 THEN WallRot:=WallRot+180; IF (SymRot=WallRot) & SymFlip THEN SymAngle:=WallRot-90; IF (SymRot=WallRot) & NOT SymFlip THEN SymAngle:=WallRot+90; IF (SymRot<>WallRot) & SymFlip THEN SymAngle:=WallRot+90; IF (SymRot<>WallRot) & NOT SymFlip THEN SymAngle:=WallRot-90; IF SymAngle<0 THEN SymAngle:=360+SymAngle; {place the text on the clicked object} TextOrigin(x,y); CreateText(Num2Str(2,SymAngle)); RedrawAll; END; END; END; END; Run(Example);
  19. I don't think there's a direct way to get the info you want, but maybe this will help. The problem is that you need to get the Handle of your door that's in the wall, but because it's in a wall, you'll get the Handle of the wall instead of the door. Here's a script from the Dutch VW forum, i rewrote it a little so you'll get the Angle and if the door is flipped or not. PROCEDURE Example; VAR x,y : REAL; keyhit : INTEGER; h : HANDLE; InMu : HANDLE; BB1,BB2 : POINT; BEGIN keyhit:=27; WHILE NOT keydown(keyhit) DO BEGIN GetPt(x,y); h:=PickObject(x,y); IF h<>NIL THEN BEGIN {look if the chosen object is a wall} IF (GetType(h)=68) THEN BEGIN {get the handle of the first object in that wall} InMu:=FIn3D(h); IF InMu<>NIL THEN BEGIN REPEAT {If the object is a Symbol or a pio, then...} IF (GetType(InMu)=86) OR (GetType(InMu)=15) THEN BEGIN {...take the bounding box of that object} GetBBox(InMu,BB1.x,BB1.y,BB2.x,BB2.y); {if the mouseclick is located in that BBox, then that's the object we need} IF (PtInRect(x,y,BB1.x,BB1.y,BB2.x,BB2.y)) THEN h:=InMu; END; InMu:=NextObj(InMu); UNTIL(InMu=NIL); END; END; {place the text on the clicked object} TextOrigin(x,y); CreateText(ConCat(GetSymRot(h),' / ',IsObjectFlipped(h))); RedrawAll; END; END; END; Run(Example); (To use it, just activate the script and click on your door, press esc to stop.) And then you'll get this: Then with a simple IF (rotation=...) & Flipped THEN Oriantation:='North' you can get the oriantation. Not completely sure, but i think this would do the trick... EDIT: Sorry, i see now that you need the angle of the door... Then you need a little bit more.. I'll look for it and let you know if i find something.
  20. I ones had the same thing, but the loci were also in groups inside those symbols. That's why i wrote this script (not to diss you panta rhei, cause your script works fine if the loci are not in a group). {maarten - 15 augustus 2008} PROCEDURE VerwijderLocus; VAR NumSym : INTEGER; SymHand : DYNARRAY of HANDLE; tmpHand : HANDLE; tel : INTEGER; PROCEDURE DeleteLocussen(h : HANDLE); BEGIN DelObject(h); END; BEGIN {plaats de symbolen in de tekening} NumSym:=SymDefNum; ALLOCATE SymHand[1..NumSym]; tmpHand:=FSymDef; FOR tel:=1 TO NumSym do BEGIN Symbol(GetSDName(tmpHand),0,0,0); SymHand[tel]:=LNewObj; tmpHand:=NextSymDef(tmpHand); END; {verwijder alle locussen} ForEachObject(DeleteLocussen,INSYMBOL & INVIEWPORT & (T=Locus)); {verwijder de symbolen} FOR tel:=1 TO NumSym do DelObject(SymHand[tel]); RedrawAll; END; RUN(VerwijderLocus);
  21. Awesome, thanks Dieter! I would never have found that "-105" one...
  22. I have some hatches in my drawing, some of them are imported from the Standard Hatches File (Userfolder/.../VW/Libary/Hatches) and some are not. Now i want to know which ones are not. So i thought of making a list of all the Hatches in that Standard document and compare them with the list of the hatches in the drawing. But BuildResourceList(66,105,'',VarLInt) gives you a list of those standard hatches AND the ones in your drawing. So, does anyone know an other way to get a list of the hatches that are not from the Standard Hatch File?
  23. It's limited to 100 for many years, i even think it was already so in the Minicad days.
  24. Open the file users/your name/Libary/VW/2008/error ouput.txt and remove all the text in it and save it. Normally you'll get the right error then. Best is to make a backup of that one file before changing it.
  25. If you select the pio in the VS list and click on the button "change name" (andere naam), you can change the name and that name will be displayed in the OIP. I'm not sure if it will have any concequences for the working of other pio's though... I think not cause CallTool doesn't use the name of the pio but the reference number.
×
×
  • Create New...