Jump to content

maarten.

Member
  • Posts

    387
  • Joined

  • Last visited

Everything posted by maarten.

  1. I'm not completely sure what you want to do, but with this script, all the Symbols Definitions in the document will get the record 'RecordName' attached and in the field 'RecordField', the name of the Symbol Definition will be placed. PROCEDURE da_muel; CONST Rname = 'RecordName'; Fname = 'FieldName'; VAR id,aant,tel : INTEGER; h : HANDLE; BEGIN id:=BuildResourceList(16,0,'',aant); IF aant<>0 THEN FOR tel:=1 TO aant DO BEGIN h:=GetResourceFromList(id,tel); SetRecord(h,Rname); SetRField(h,Rname,Fname,GetActualNameFromResourceList(id,tel)); END; END; RUN(da_muel);
  2. Thanks for the tip Miguel, didn't knew that! Not completely on topic, but maybe useful non the less: A criteria can not be a DynArray of Char but must be a String. That means that it's limited in length. I noticed this some weeks ago in one of my scripts where in some options i had a quite long criteria, i had to rebuild it to make it work.
  3. A criteria is actually a string, so you can use (c : STRING).
  4. The problem is that ForEachObjectInLayer needs a Function in stead of a Procedure. You also forget the Handle. So Procedure RotTest; should be Function RotTest(h : HANDLE) : BOOLEAN; SetSelect(h); This isn't necessary. Most of the time, you don't need to select your objects to adjust them in VS rot :integer; Better would be to make it a Real in stead of an Integer. Otherwise your value will get rounded. So 179,8 will become 180 and i don't think that is what you want (could be wrong of course). ForEachObjectInLayer(RotTest, 2, 0, 4); Here you're passing almost every object on the active layers to the Procedure RotTest. That way you'll also try to adjust that record field even if the object doesn't have that record attached. Better would be: ForEachObject(RotTest,(R IN ['Lighting Device'])); Now you'll only pass that objects that have that record attached. But be aware, this will pass objects on all layers while ForEachObjectInLayer only passed objects on the layers you choosed. Also, this procedure doen't need a Function to call, but a Procedure.
  5. Can you not use CallTool(-309) in stead of GetPt3D? It calls the Place 3D Symbol tool. You need to make your symbol first, then activate it (if it wouldn't be active already) with ActSymDef and call that tool.
  6. Very strange, i tried it yesterday and it did work, but now i can't seem to reproduce it... I must stop posting things so early in the morning . Oke, here's an other way of doing this: Procedure CustTool; VAR Name:STRING; Result:BOOLEAN; tmph,h:HANDLE; BEGIN PushAttrs; Locus(0,0); tmph:=LNewObj; Result := DeleteAllDLComponents; Result := InsertNewDLComponent(1, 20, 1, 0, 2, 2, 2); Result := SetDLComponentName(1, 'BLACK'); Result := SetDLComponentClass(1, 0); Result := SetDLComponentFillColors(1, 257, 257); Result := SetDLComponentPenColors(1, 257, 256, 257, 256); Result := SetDLComponentUseFillClassAttr(1, FALSE); Result := SetDLComponentUsePenClassAttr(1, FALSE, FALSE); Result := InsertNewDLComponent(2, 10, 1, 2, 0, 2, 2); Result := SetDLComponentName(2, 'RED'); Result := SetDLComponentClass(2, 0); Result := SetDLComponentFillColors(2, 257, 1251); Result := SetDLComponentPenColors(2, 257, 256, 257, 256); Result := SetDLComponentUseFillClassAttr(2, FALSE); Result := SetDLComponentUsePenClassAttr(2, FALSE, FALSE); SetDLSeparation(30); SetDLControlOffset(0); SetDLOptions(1); CallTool(-218); PopAttrs; DSelectAll; h:=NextObj(tmph); DelObject(tmph); SetSelect(h); DoMenuTextByName('Convert to NURBS',0); END; Run(CustTool); You need to adjust the last line DoMenuTextByName('Convert to NURBS',0); by something else. I don't have Spotlight so i can't call that menu item. It should be something like DoMenuTextByName('Convert to Lighting Position Object',0);
  7. BTW, the small component isn't red on my computer, probable because "1251" is not a standard color... Result := SetDLComponentFillColors(2, 257, 1251); If you need to use this on other computers too, i think its safer to use "7" for red, that's the standard color and will normally work on every drawing. Result := SetDLComponentFillColors(2, 257, 7);
  8. First of all, why do you use CallTool(-218); two times? I think one is enough. You can use this at the end of your script: DSelectAll; h:=PrevObj(PrevObj(LObject)); SetSelect(h); h is the handle to that "base" poly. SetSelect(h) makes sure that that poly is selected after execution. I have no idea what a Lighting Position Object is (i have a Dutch translation of VW) and can't find it in the menus, so maybe somebody else know a way to Convert it?
  9. When you get weird or wrong Compile Errors, remove the Error Output.txt file in your user folder and Compile again. Sometimes an old Error is displayed.
  10. Maybe i didn't understand the question completely, but why don't you just use Boolean:=CallToolByName('Drawing label'); ?
  11. Works fine here... Although, strange thing here's that the main Pio is highlighted after creation while the inner Pio is not. When i move the whole, it does get highlighted though, as it should be. So maybe its a redraw problem? Have you tried a Redraw? When you ungroup everything, is the inner PIO visible, selectable, present (you can do a Count or something to see if it's there)? How do you call the inner Pio in the Main Pio and how do you update the Main Pio in the commando? I did it with CreateCustomObject in the Main Pio and ResetObject in the commando and it seems to work fine here (VW2008).
  12. A question about the VS Editor... I hear some of you say that you don't use the VS Editor but a text editor with a VS language module. I too use Notepad++ with such a module at work and it does work great but one thing that i miss the most is a way to compile my scripts... So, is there a way to do this in one of those text editors? If so, i too would leave the VS Editor for what it is and use a text editor.
  13. You can leave this line out cause the selection status isn't important. DSelectAll; SelectObj(INSYMBOL & INVIEWPORT & (T=Symbol)); Why don't you use ForEachObject like Miguel suggested? That way you don't need to convert your symbols to groups...
  14. Out the VS Language Guide So you need to use something like Apple Script or something alike to open the files and run the VS on them.
  15. Forgot to mention that I also tried these: Message(GetTextureRefN(FSActLayer,0,0,FALSE)); Message(GetTextureRefN(FSActLayer,0,1,FALSE)); Message(GetTextureRefN(FSActLayer,1,0,FALSE)); Message(GetTextureRefN(FSActLayer,1,1,FALSE)); Message(GetTextureRefN(FSActLayer,2,0,FALSE)); Message(GetTextureRefN(FSActLayer,2,1,FALSE)); But again, they all give 0...
  16. Hello all Does anybody know how to get the texture that's attached to the left and right side of a wall? These things I already tried to no avail... Message(GetObjectVariableInt(GetObject('Muurstijl'),1135)); Message(GetObjectVariableInt(GetObject('Muurstijl'),1137)); {Muurstijl is the name of the Wall Style} Those two both give 0 as answer. Message(GetTextureRef(FSActLayer,0,FALSE)); Message(GetTextureRef(FSActLayer,1,FALSE)); Message(GetTextureRef(FSActLayer,2,FALSE)); {FSActLayer gives the handle of a drawn wall} Those also give 0 as answer... Anybody else got an other idea?
  17. You can do that like this. Get the attribute of the old class and then set the attribute to the new class. You still need to ad all the other attributes that you want to keep to this exaple though, this example only sets the fore and background fill color. There's a list of Procedures in the FR under the "Classes" chapter. Most of them are about the attributes of the classes. {/// cut ///} curClass:= oldList[i]; IF Count(INSYMBOL & INOBJECT & INVIEWPORT & (C=curClass))<>0 THEN BEGIN GetClFillBack(curClass,red,green,blue); SetClFillBack(newList[i],red,green,blue); GetClFillFore(curClass,red,green,blue); SetClFillFore(newList[i],red,green,blue); {and so on} END; ForEachObject(ChangeName,(INSYMBOL & INOBJECT & INVIEWPORT & (C=curClass))); {/// cut ///} EDIT: or like Petri says, that would make it much easier and it will probable executes faster too.
  18. maarten.

    select

    Hi Vincent If those values are parameters that you can see in the Object Info Palette, then you can also check those value with: IF GetRField(Handle of parking,Name of Plugin,Name of Field)=12,8m THEN ... To get the name of plug in and field, you could make a report of those objects, then you can see them in the formula bar.
  19. Or you could do it manually, here's an example to do so: FOR cnt1 TO total-1 DO BEGIN FOR cnt2 TO total-1 DO BEGIN IF array[cnt1] > array[cnt1+1] THEN BEGIN tmp:=array[cnt1]; array[cnt1]:=array[cnt1+1]; array[cnt1+1]:= tmp; END; END; END; {and here's the same code, bug with some more information (not sure if it makes it more clear or even the opposite )} {repeat this part for as many index-1 the Array has} FOR cnt1 TO total-1 DO BEGIN {run trough the Array except for the last index} FOR cnt2 TO total-1 DO BEGIN {if the index you're checking now is bigger then its follower...} IF array[cnt1] > array[cnt1+1] THEN BEGIN {... switch the values of those two} tmp:=array[cnt1]; array[cnt1]:=array[cnt1+1]; array[cnt1+1]:= tmp; END; END; END;
  20. That goes for most of the wishes. You'll always have people who like it and want to use it and others who want to keep it to the old. It's never good to make something completely new and trow away the old things. But this shouldn't stop them from changing the UI in my opinion. Why not have a preference where you can choose to use the "Classic VW interface" or the "New VW interface". That way you wouldn't hurt the "normal" users (which are the majority) but you'll give the advanced users the chance to rebuild their whole interface to fill in their needs.
  21. We had a discussion about this on the Dutch board in 2007. My suggestion was that VW would have dynamic pallets with tabs in it. Every palette would be a tab and you can take it and drag it in whatever other palette you want (like in Photoshop). That way you can make your own layout. So you can have for example the Info part of the OIP visible and also the Data and/or Render part at the same time. The Attribute palette would be resizable like the Tools pallets so that the parts can switch intern (see above image for more info). That way you loose less screen space. An other thing was about being able to open more then one of the same pallets. That way you can have the Classes and Layers part of the navigation pallet visible. Same goes for the Tools, when you need the Architect tools and Dims/notes tools at the same time, you can open a second Tools palette, do your thing and when you're done, you can close the second Tools palette. For those who understand Dutch can always have a read here .
  22. Agree with all 10 of Chris' points. Advanced users who actually know how to use those features will turn them back on, the other users don't even know if the existence of them so wouldn't even missing them and therefor wouldn't use them accidentally.
  23. SetDashStyleN('My Dash Style', True,num,pair1DX,pair1DY,pair2DX,pair2DY,pair3DX,...); doesn't have a GetDashStyleN
  24. Ow, and it would be cool if you trow in some fancy colors to pimp the code like most editors do .
×
×
  • Create New...